Hi All,
I have a problem with the DataViz Pie Chart.
Here is the idea: I have a global variable where I store key/value pairs. Keys represent the id of the div where the chart will be rendered and the value is the array for the dataSource.
Example:
['chart1' : [ { category :"Category1", value:"value1", color: "#BBBBBB" }....]
here I have the configuration for the chart and the creation of DataSource:
First time the Chart is rendered correctly.
When I want to update the datasource (let's say I create a new Instance of kendo.data.DataSource or I use the add(model) method of the datasource) the chart loads as seen on the attached picture. After updating the datasource or using the add method am using the refresh() method of the chart to redraw.
I am pretty sure that I am not doing something ok with the datasources, but I can't figure it out.
Thanks in advance,
Gergő
I have a problem with the DataViz Pie Chart.
Here is the idea: I have a global variable where I store key/value pairs. Keys represent the id of the div where the chart will be rendered and the value is the array for the dataSource.
Example:
['chart1' : [ { category :"Category1", value:"value1", color: "#BBBBBB" }....]
here I have the configuration for the chart and the creation of DataSource:
var
newDataSource =
new
kendo.data.DataSource({ data: GLOBAL_ALL_PIE_DATA[controlID] });
var
chartConfiguration = {
theme: $(control).attr(
"theme"
),
title: { text: $(control).attr(
"title"
) },
legend: {
position: $(control).attr(
"position"
)
},
seriesDefaults: {
labels: {
visible: $(control).attr(
"showLabels"
),
format:
"{0}%"
}
},
dataSource: newDataSource,
series: [{
type:
"pie"
,
categoryField:
"category"
,
field:
"value"
,
colorField:
"color"
}],
tooltip: {
visible: $(control).attr(
"showTooltip"
),
format:
"{0}%"
}
};
//create the chart
$(jqControlID).kendoChart(chartConfiguration);
}
}
}
First time the Chart is rendered correctly.
When I want to update the datasource (let's say I create a new Instance of kendo.data.DataSource or I use the add(model) method of the datasource) the chart loads as seen on the attached picture. After updating the datasource or using the add method am using the refresh() method of the chart to redraw.
I am pretty sure that I am not doing something ok with the datasources, but I can't figure it out.
Thanks in advance,
Gergő