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

Repetition of horizontal axis label

1 Answer 167 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Yugal
Top achievements
Rank 1
Yugal asked on 12 Aug 2013, 02:10 PM
Hi,
I have been adding time values to horizontal axis in milliseconds. As the time exceeds 1000 milliseconds it gets converted to seconds and so on. When time value already exists in the horizontal axis then the graph gets overlap for that time.
For example:- values for 1 millisecond and value for 1000 millisecond(which after conversion becomes 1 second) get overlapped. Similarly, for 1 millisecond and 60000 millisecond(which after conversion becomes 1 minute).
How to avoid these points from getting overlapped and  how can we distinguish them?

 if(TimeValue < 1000)
                            {
                                XAxis.Title = "Time (milliseconds)";
                              _weldDataMapping.Series.DataPoints.Add(new Telerik.Charting.CategoricalDataPoint { Category = TimeValue, Value = val });
                            }
                            else if (TimeValue >= 1000 && TimeValue <= 60000)
                            {
                                XAxis.Title = "Time (seconds)";
TimeValueInSec = Math.Round(TimeValue / 1000, 4);
                               _weldDataMapping.Series.DataPoints.Add(new Telerik.Charting.CategoricalDataPoint { Category = TimeValueInSec , Value = val });
                            }
and so on for the conversion in minute and hours......

I have attached two images which shows value for 990 millisecond and den 1010 millisecond. And value for 1000 millisecond which after conversion has become 1 second overlaps with value of 1 millisecond (shown as a straight line coming back to 1 millisecond).
Please provide the solution as soon as possible.
Thanks.

1 Answer, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 15 Aug 2013, 11:51 AM
Hi Yugal,

This behavior is caused by the fact, that RadCartesianChart treats "1" as the same category, each time it finds it. It is not aware of the meaning you put in it -- millisecond, second, minute, etc. A possible workaround here is to place whitespaces in the strings used for category. This way the user would still see "1" while the chart will print "1" for millisecond, " 1" for second, " 1 " for minute, etc.

Best regards,
Ves
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
ChartView
Asked by
Yugal
Top achievements
Rank 1
Answers by
Ves
Telerik team
Share this question
or