Scatter series - Incorrect values shown after resizing the RadChart component

7 posts, 0 answers
  1. Jussi
    Jussi avatar
    8 posts
    Member since:
    Nov 2010

    Posted 27 Sep 2012 Link to this post

    I have a scatter series where all the values are aligned at Y == 1.0. The RadChart is inside a grid with a gridsplitter controlling the space available for the RadChart. Now, if I scale the view vertically, sometimes values are displayed incorrectly (see red triangles in the example screenshots below). This issue doesn't appear always, but often enough to be a serious problem for us. If the problem occurs, the only way to fix it is to resize the RadChart again, horizontally (always fixes the problem) or vertically (usually fixes the problem, sometimes the problem reappears).

    We are not changing the data bindings or anything like that, we are simply rescaling the grid view with the gridsplitter. With the data in the screenshots it is very easy to see that triangles were rendered at incorrect Y-values. But we have other visualizations where the scatter data is not aligned to a single Y axis value and we can't afford the items to be displayed at incorrect values!

    I'm limited to version Q2 2011, what can we do to fix this?

       - Jussi

    View opens:


    After scaling vertically:


    And after additional scaling:


    Here's an example of the blue and red scatter series, both using exactly the same data binding:


    Obviously, this is not acceptable.
  2. Jussi
    Jussi avatar
    8 posts
    Member since:
    Nov 2010

    Posted 27 Sep 2012 Link to this post

    I found a solution for the problem described below. All integer values are correctly displayed after setting SamplingThreshold to 0. I don't think that resampling of data is a good default for scatter series in general.

    My original problem in the first post to this thread (i.e. Y-values jumping during and after resize) still exists.

    [Original post]
    I noticed an additional problem with scatter plots. ScatterSeries 'invents' decimals to my integer Y values. Here's the series definition and item mappings:



    And this is the data this series is bound to:



    As you can see, the X values are doubles, Y values are integers. Still, within the first few values of this series, my integer Y values are displayed like this:



    Scatter points get drawn with Y values of 2,5 and 5,5 even though the data are integers. How is it possible that RadChart doesn't display these values correctly? Please tell me there is a rational explanation and a way to fix this.
    [/Original post]
  3. UI for WPF is Visual Studio 2017 Ready
  4. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 01 Oct 2012 Link to this post

    Hello Jussi,

    Can you please, provide more information about the problem? I have attached a small example, which works as expected on my end. You can modify it so that it matches your scenario and the issue is reproduced. Then you can send it back to us for further investigation.

    Best regards,
    Ves
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  5. Jussi
    Jussi avatar
    8 posts
    Member since:
    Nov 2010

    Posted 02 Oct 2012 Link to this post

    This zip file contains code to reproduce the bug. Image below shows what sometimes happens after resize. I don't know if the gridsplitter is even needed, this bug can also occur when resizing the MainWindow.

       - Jussi

  6. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 04 Oct 2012 Link to this post

    Hi Jussi,

    Thank you for the additional details. Indeed, the issue is reproduced as described. It seems there is a problem with scatter series in this scenario. It only seems to appear when the axis range is updated. So I set AxisY.AutoRange is set to false and the issue went away:

    RadChart1.DefaultView.ChartArea.AxisY.AutoRange = false;
    RadChart1.DefaultView.ChartArea.AxisY.AddRange(0, 2, 0.5);


    Best regards,
    Ves
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  7. Jussi
    Jussi avatar
    8 posts
    Member since:
    Nov 2010

    Posted 04 Oct 2012 Link to this post

    I am not in control of the incoming data, and because of that cannot set the Y axis range beforehand. Sometimes we are binding to data in the range between 0...0.05, sometimes 0...3, sometimes 0...1000. Clearly I must have the chart automatically adjusting axis range depending on the incoming data.

    So, what are my options?
  8. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 09 Oct 2012 Link to this post

    Hi Jussi,

    I am afraid, the issue will appear with automatic axis range, so you will need to set it manually. You can wire the ItemDataBound event of RadChart. It will be triggered for every item, so you can track the min and max values in order to calculate appropriate range for the Y axis.

    Best regards,
    Ves
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
UI for WPF is Visual Studio 2017 Ready