Date label rendering with alternate pattern on x-axis in line chart series

3 posts, 0 answers
  1. Deepak
    Deepak avatar
    11 posts
    Member since:
    Dec 2014

    Posted 09 Jul 2015 Link to this post

    Hi,

     Please can you guide me with this issue, I have also attached the screen shot for better understanding. I want to render date labels with "two line format" first line day and month name then in second line time value. How this can be achieved. I have checked with chartLabelRenderer but did not found much regarding this.

     

    Also the rendering should happen alternatively on x-axis, So that when I render it for first tick then second tick should be left empty and third tick should render the date label like wise will be followed for rest all other ticks, And I also want to limit the number of ticks that will render on the x axis.

     

    Thanks,

  2. Deepak
    Deepak avatar
    11 posts
    Member since:
    Dec 2014

    Posted 09 Jul 2015 in reply to Deepak Link to this post

    Hi Telerik support Team,

    please can you look in to this on priority.

    Thanks,

  3. DevCraft banner
  4. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 11 Jul 2015 Link to this post

    Hi Deepak,

    You can render the date string by setting a date format:

    Please note that rendering a single label on multiple lines is not possible at them moment. If the labels overlap each other different labels can rendered on different lines so that they don't overlap however a single label is always on one line.

    You can tell your axis to skip every other label like this:
    axis.setDateTimeFormat(new SimpleDateFormat("dd MMM hh:mm aaa"));

    To skip more labels increase the argument number.
    axis.setLabelInterval(2);

    Also you can use the label fit mode strategies if the labels become too cramped:
    weekHorizontalAxis.setLabelFitMode(AxisLabelFitMode.MULTI_LINE);
    The fit modes can be multi-line, rotate and none.

    Please write again if you need further assistance.


    Regards,
    Victor
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top