Possible To Offset Axis Labels?

Thread is closed for posting
2 posts, 0 answers
  1. Alex
    Alex avatar
    1 posts
    Member since:
    Sep 2012

    Posted 22 Oct 2012 Link to this post

    Hello,

    I'm working with the asp.net RadChart, trying to more finely tune the displayed labels associated with a chart.

    Specifically, I'd like to start the axis labels and ticks at a point not at the start of the data, or at 0. In the attached files, I have my current chart's axis (with RadChart) where the labels start at the minValue and end with the maxValue of the Axis.

    Target.png represents what I'd like to see in the chart, with the label starting at a pre-defined point in the data. In this case, I'd like to start my labeling at July 1, 2010 instead of April 28, 2010 in the dataset.

    Is there an easy way to do this?


    Thanks,
    Alex Bucevicius
  2. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 24 Oct 2012 Link to this post

    Hi Alex,

    You can try to set the LayoutMode of the axis to Inside:
    this.RadChart1.PlotArea.XAxis.LayoutMode = Telerik.Charting.Styles.ChartAxisLayoutMode.Inside;

    Additionally you can put the X-axis into manual mode. Set it's AutoScale property to false and set whatever you need for min, max and step:
    this.RadChart1.PlotArea.XAxis.AutoScale = false;
    this.RadChart1.PlotArea.XAxis.AddRange(new DateTime(2012, 10, 24).ToOADate(), new DateTime(2012, 10, 30).ToOADate(), 1);

    All the best,
    Petar Marchev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top