When selection is performed, the chart refreshes somehow, but not correctly.
Please refer to the attached sample.
In this sample, “Author” is filtered, and the chart is grouped by “Auther”.
So that the expected result is that only one bar labelled “Stephen King” shows up.
As this sample is only for showing the problem, the grouping has no practical meaning.
You need to rebuild chart every time you need to detail your authore statistics.
Recommend you to use group and sort functions separatelly from main chart init.
And to get detailed author satistics you need to filter your chart data and draw only sales of this author.
To get you author from grig filter event you can the next way:
mygrid.attachEvent("onFilterEnd",function(elements){
var author = elements[0][0].value;
...
Thank you for your suggestion.
I understand that synchronization between grid and chart is not
automatic when used with filtering.
I tried a tricky chart filtering like:
function refresh_chart(){
barChart.clearAll();
barChart.filter("Author",""); // this is the trick filtering without specifying filter value
barChart.parse(mygrid,"dhtmlxgrid");
};
and found that it gives an expected result for me.
Surprisingly, filtering value in grid is automatically reflected to chart.
Do you think this is another possible resolution ?
You can try to use it, BUT…
After inspection your demo one more time we found that your demo would be ok if you would upgrage your files till the latest 3.6 version.
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan