***Edit - attached a full example that reproduces the problem shown in my attached screenshot. Tested under IE 9 and Firefox 10.0 - both are missing the zero Y-Axis value.... not sure why.
See attached image. For some reason the Y-axis is not including zero, but rather starts at the lowest value contained in my JSON file.
JSON data:
This is my chart function that I re-use over and over, passing in a different DIV each time:
Here is the HTML /script thats used to call the above function, passing in the arguments:
See attached image. For some reason the Y-axis is not including zero, but rather starts at the lowest value contained in my JSON file.
JSON data:
[
{
"CategoryText" : "Previous",
"SeriesValue" : 321131.5225
},
{
"CategoryText" : "Current",
"SeriesValue" : 300059.4610
}
]
This is my chart function that I re-use over and over, passing in a different DIV each time:
var DELAY = 400;
function
createGenericBarChart(ChartName, JsonPath, ChartType, Title, LegendVisible, LegendPosition, CategoryLabelRotation, ValueLabelRotation, Stacked, SeriesLabelsVisible,
SeriesLabelsFormat, ToolTipLabelFormat, CategoryAxisField, BarSeriesDefinition, Maximized) {
$(ChartName).kendoChart({
dataSource: {
transport: {
read: {
url: JsonPath,
dataType:
"json"
}
}
},
title: {
text: Title,
font:
'14px Arial'
},
legend: {
position: LegendPosition,
visible: LegendVisible,
font:
'8px Arial'
},
seriesDefaults: {
type: ChartType,
stack: Stacked,
labels: {
visible: SeriesLabelsVisible,
position:
"outsideEnd"
,
format: SeriesLabelsFormat,
font:
'10px Arial'
}
},
series: BarSeriesDefinition,
valueAxis: {
labels: {
visible:
true
,
rotation: ValueLabelRotation,
font:
'10px Arial'
}
},
categoryAxis: {
field: CategoryAxisField,
labels: {
rotation: CategoryLabelRotation,
font:
'10px Arial'
}
},
tooltip: {
visible:
true
,
font:
'12px Arial'
}
});
}
Here is the HTML /script thats used to call the above function, passing in the arguments:
<div id=
"dshitem1_1_divChart"
class=
"Chart"
style=
"z-index:8999;"
>1</div>
<script>
function
DashboardCaller1(chartid, maximized) {
var
BarSeries = [{
field:
"SeriesValue"
,
name:
"SeriesValue"
}];
createGenericBarChart(chartid,
'2626_1_Bar - Airline Contract AC -SUN_.json?id=59bd4fee-511f-480b-bbee-88c3051b800d'
,
'column'
,
'Bar - Airline Contract AC -SUN'
,
false
,
'top'
, -45, 0,
false
,
false
,
'{0:N2}'
,
'{0:N2}'
,
'CategoryText'
, BarSeries, maximized);
}
setTimeout(
function
() {
DashboardCaller1(
'#dshitem1_1_divChart'
,
false
);
}, 1 * DELAY);
</script>
</div>