This is a migrated thread and some comments may be shown as answers.

Multiple series not overlapping properly

2 Answers 100 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Matt Dufrasne
Top achievements
Rank 1
Matt Dufrasne asked on 10 Sep 2014, 11:01 PM
I have a data source that is grouped to create a multi-series line chart.  The category axis values for each series do not include all values seen in all other series, so I am using the series' "categoryField" property instead of the categoryAxis' "field" property.  

I want to toggle between two types of information for the category axis.  When the category axis is set to display date information, everything displays nicely.  However when the category axis is switched to display a different type of information, the series are not plotted over-top of each other but instead side by side.  This is in spite of the fact that the category axis values should be intermixed between the series.

See my example here:  http://jsfiddle.net/yd6oxkfm/1/

When the Id toggle is clicked, the series are sorted by Id within each series, but the overall axis data is side by side (and not in sorted order), unless both series happen to have data for the same Id number.  How can I get the series to plot as nicely for Id as they do for Date?

2 Answers, 1 is accepted

Sort by
0
Accepted
T. Tsonev
Telerik team
answered on 12 Sep 2014, 10:51 AM
Hello,

I'm not quite sure why the data source sorting is not getting applied correctly. Perhaps the chart responds to the change event sooner than we manage to apply the new settings.
In any case, doing the sorting in the dataBound event seems to help:
dataBound: function(e) {
    e.sender.options.categoryAxis.categories.sort();
}


I hope this helps.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Matt Dufrasne
Top achievements
Rank 1
answered on 12 Sep 2014, 07:12 PM
That works, thanks!
Tags
Charts
Asked by
Matt Dufrasne
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Matt Dufrasne
Top achievements
Rank 1
Share this question
or