How to control the plot order for multiple series

3 posts, 0 answers
  1. mao
    mao avatar
    5 posts
    Member since:
    Oct 2016

    Posted 01 Nov 2016 Link to this post

    for example, 

    Series 1:   X: P1 P1 P2

                     Y   2   3  4     


    Series 2   X:P1 P1 P2

                    Y: 5   6   7


    If they are plotted in graph as bar series. I expected the plot order as (series1 ->P1,2) (series2->P1,5) (series 1->P1,3) (series 2->P1,6) (series1 ->P2,4) (series2 ->P2,7) . that means all the P1 category  will be grouped together and has the value order  as (2,5,3,6). And P2 category has value order(4,7)




    but actually, it looks like P1 category  has the value order as (2,3,5,6)   and P2 category has value order(4,7)


    in order to achieve what I want, I have to flatten the two series (series1 and series 2) into one series. But that approach is not exactly what I want. Thank you

  2. Tanya
    Tanya avatar
    583 posts

    Posted 04 Nov 2016 Link to this post

    Hi Mao,

    Let me first explain in more details how RadChartView renders the series data points.

    When a single series is passed for the categorical axis, its points are plotted in the order they appear in the collection. When the series are more than one, each slot of the categorical axis is divided corresponding to the number of the series which holds. 

    I am going to use the sample scenario from your post. It contains two series, therefore, each category slot (P1 and P2) will be divided into two parts - the first one will accommodate the data points of the first series and the second one - from the second series. The slots are filled with the data points consecutively, starting with the data points from the first declared series.

    With that said, the workflow of the rendering as well as the end result would look as follows:

    P1 will contain two parts:
    P1 (1) will accommodate the P1's values from the first series - 2 and 3
    P1 (2) will be reserved for the data points of the second series from the P1 category - 5 and 6

    P2 is divided into two parts as well:
    P2 (1) renders 4
    P2 (2) renders 7

    The plot order is automatic and you can control it only through the collection you are passing to the series. Having this in mind, the union of both collections and using a single series is the only approach I can suggest you.

    Hope this is helpful.

    Telerik by Progress
    Do you need help with upgrading your WPF project? Try the Telerik API Analyzer and share your thoughts!
  3. mao
    mao avatar
    5 posts
    Member since:
    Oct 2016

    Posted 04 Nov 2016 in reply to Tanya Link to this post

    Thank you so much, Tanya. Very helpful explanation. 
Back to Top