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

Scatter series - Incorrect values shown after resizing the RadChart component

6 Answers 97 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Jussi
Top achievements
Rank 1
Jussi asked on 27 Sep 2012, 08:25 AM
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.

6 Answers, 1 is accepted

Sort by
0
Jussi
Top achievements
Rank 1
answered on 27 Sep 2012, 10:06 AM
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]
0
Ves
Telerik team
answered on 01 Oct 2012, 04:27 PM
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.

0
Jussi
Top achievements
Rank 1
answered on 02 Oct 2012, 06:21 AM
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

0
Ves
Telerik team
answered on 04 Oct 2012, 12:08 PM
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.

0
Jussi
Top achievements
Rank 1
answered on 04 Oct 2012, 12:32 PM
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?
0
Ves
Telerik team
answered on 09 Oct 2012, 07:34 AM
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.

Tags
Chart
Asked by
Jussi
Top achievements
Rank 1
Answers by
Jussi
Top achievements
Rank 1
Ves
Telerik team
Share this question
or