Two different ChartAxisLayoutMode in one RadChart?

Thread is closed for posting
4 posts, 0 answers
  1. Saranya
    Saranya avatar
    10 posts
    Member since:
    Apr 2013

    Posted 02 Sep 2013 Link to this post

    Hi,

    I have a radchart with two line series. One of them is a horizontal line, which represents a threshold value. 
    I would want this line series to have a ChartAxisLayoutMode.Normal and the other line series to have a ChartAxisLayoutMode.Between or Inside.

    series1.PlotArea.XAxis.LayoutMode = ChartAxisLayoutMode.Normal;
    series2.PlotArea.XAxis.LayoutMode = ChartAxisLayoutMode.Inside;


     How do I do this? Currently, the one written last is overriding the previous.

    Thanks


  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1183 posts

    Posted 05 Sep 2013 Link to this post

    Hi Saranya,

    Please note that the LayoutMode property is part of the axis - rather than the series itself. Please try to set this property on the axis and let us know if you have any other questions.

    Regards,
    Pavel R. Pavlov
    Telerik
    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 the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Saranya
    Saranya avatar
    10 posts
    Member since:
    Apr 2013

    Posted 06 Sep 2013 Link to this post

    Thanks Pavel, but then how do I simulate a threshold series if another one of my line series has to be with LayoutMode  = Between
  5. Petar Kirov
    Admin
    Petar Kirov avatar
    425 posts

    Posted 11 Sep 2013 Link to this post

    Hi Saranya,

    The ASP.NET AJAX RadChart supports only a single LayoutMode for all of its series. I believe that you need separate Layout mode for the horizontal threshold line, because you want it to extend from end to end.
    If that is the case, you can set the RadChart.PlotArea.XAxis.LayoutMode to the mode you prefer to be used for your regular series, and extend the horizontal line by setting more separate XVaues to its first and last items. Here's an example:
    //The range of the axis is from 0 to 100
    //Draw a horizontal line at 70 from start to end:
    int start = 0;
    int end = 100;
    var horizontalLine = new ChartSeries { Type = ChartSeriesType.Line };
    horizontalLine.AddItem(new ChartSeriesItem(start, 70));
    horizontalLine.AddItem(new ChartSeriesItem(end, 70));
                     
    //extend its range:
    horizontalLine[0].XValue -= (end - start) / 2;
    horizontalLine[1].XValue += (end - start) / 2;
    this.chartCensusBudget.Series.Add(horizontalLine);

    I hope this helps.

    Regards,
    Petar Kirov
    Telerik
    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 the blog feed now.
Back to Top