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

Display a line for 0 value data

5 Answers 160 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Jinyan
Top achievements
Rank 1
Jinyan asked on 31 Jul 2012, 01:47 AM
I am trying to build a real time data visualizer using telerik radchart. However, more often than not the first few minutes or so the data source does not have any data (thus the data points on the chart are 0s). I want the users to be able to see the 0 values as a line instead of just an empty graph with moving X axis. Any pointers on how I can achieve this?

Much appreciated.

5 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay
Telerik team
answered on 02 Aug 2012, 08:06 AM
Hi Jinyan Cao,

By default the chart would draw a line even if there are only zero values, however, in most cases it would not be clearly visible because of the PlotAreaAxis. Here are a few suggestions that you may find appropriate for your scenario :

1. In case you are using AutoRange = True, you could set a custom axis range, for example, from -1 to 1 with a Step = 1 and then set the AxisY PlotAreaAxisVisibility to Collapsed.
2. If you have a defined manual axis range, then simply collapsing the PlotAreaAxis would work as well.
3. Another possible solution would be to increase the thickness of the Line series when there are only zero values in the chart.

All of these suggestions could be applied dynamically - while there are only zero values present in the chart. This way when there are other positive/negative values, the chart would work normally.

Hope this helps.

Greetings,
Nikolay
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Jinyan
Top achievements
Rank 1
answered on 02 Aug 2012, 10:16 PM
Thanks! I am not using custom range for Y axis and it's working like a charm.
0
danny
Top achievements
Rank 1
answered on 22 Aug 2012, 06:49 PM
How can I do this if I'm using the MVC controls?
0
Evgenia
Telerik team
answered on 23 Aug 2012, 08:02 AM
Hello Danny,

 Please ask your questions in the forum threads that are created with same Product and Technology as the one yo use. This thread relates to RadChart for WPF only.

Kind regards,
Evgenia
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
danny
Top achievements
Rank 1
answered on 23 Aug 2012, 02:38 PM
Ok sorry.  I have asked the question there and has gone unanswered for almost a month.
Tags
Chart
Asked by
Jinyan
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Jinyan
Top achievements
Rank 1
danny
Top achievements
Rank 1
Evgenia
Telerik team
Share this question
or