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

Two different ChartAxisLayoutMode in one RadChart?

3 Answers 30 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Saranya
Top achievements
Rank 1
Saranya asked on 02 Sep 2013, 09:06 AM
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


3 Answers, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 05 Sep 2013, 10:35 AM
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.
0
Saranya
Top achievements
Rank 1
answered on 06 Sep 2013, 08:39 AM
Thanks Pavel, but then how do I simulate a threshold series if another one of my line series has to be with LayoutMode  = Between
0
Petar Kirov
Telerik team
answered on 11 Sep 2013, 08:39 AM
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.
Tags
Chart (Obsolete)
Asked by
Saranya
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Saranya
Top achievements
Rank 1
Petar Kirov
Telerik team
Share this question
or