Repetition of horizontal axis label

2 posts, 0 answers
  1. Yugal
    Yugal avatar
    8 posts
    Member since:
    Jul 2013

    Posted 12 Aug 2013 Link to this post

    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.
  2. Ves
    Ves avatar
    2917 posts

    Posted 15 Aug 2013 Link to this post

    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,
    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 >>
Back to Top