Welcome to the Xceed Community | Help
Community Search  

UseXValues doesn't really work as expected?

Sort Posts: Previous Next
  •  01-24-2008, 9:23 PM Post no. 6578

    UseXValues doesn't really work as expected?

    I'm, using a LineSeries with UseXValues set to True, with that I was hoping the data plotted doesn't have to be in order (since x position was given during plotting).
    Even though the Point are placed correctly, the line drawn are still based on the order of numbers added (i.e. line is not from x-axis 0->n, but rather jumping all over due to order of the values added).
    Is there a property needed to be set, so that line drawn is not based on orders of the value being added

    Thanks
  •  01-28-2008, 9:39 AM Post no. 6579 in reply to 6578

    Re: UseXValues doesn't really work as expected?

    This is the expected behavior. UseXValues means that the chart will not generate a sequential X value to every Y value added to the series. But the DataPoints are treated in the order they are added.

    The chart object model is such that each value is assign to an array (e.g. one for X values, one for Y values, one for DataPoints labels, etc...), and the chart renders the series by going through each array, and getting every value at the corresponding index of each array.

    So if you want to change the order in which DataPoints are displayed, the only workaround I see is to insert the X values at the right index directly into the X value array, instead of adding them through the AddXY() method.

    e.g.

    line.XValues.Insert( index, value );

    André
    Software Developer and Tech Support
    Xceed Software Inc.
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.