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

Axis Crossing

1 Answer 79 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Holger
Top achievements
Rank 1
Holger asked on 14 Jan 2018, 09:47 PM

Is there meanwhile a way to control the position of the axis crossing ? It's strictly fixed to an outside corner of the ChartArea ?

I found this old thread with an answer, may be things have changed meanwhile

https://www.telerik.com/forums/drawing-x-axis-on-chart-view-at-zero-when-negative-values-exist

RadChartView is such a rich thing, it's on wonder while such a basic feature as control the axis crossing is missing.

That means a 4 quadrant chart (going f.e. from -100 to +100 on both axis, with having the axis crossing at (0,0)) is strictly impossible ?

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 16 Jan 2018, 07:27 AM
Hello, Holger,   

Thank you for writing.  

If I understand your requirement correctly you are trying to align the horizontal axis according to a specific value on the vertical axis. The following help article is quite useful on this topic: https://docs.telerik.com/devtools/winforms/chartview/axes/axis-alignment

Here is a sample code snippet for your reference which result is illustrated in the below screenshot: 

LineSeries lineSeries = new LineSeries();
lineSeries.DataPoints.Add(new CategoricalDataPoint(20, "Jan"));
lineSeries.DataPoints.Add(new CategoricalDataPoint(22, "Apr"));
lineSeries.DataPoints.Add(new CategoricalDataPoint(12, "Jul"));
lineSeries.DataPoints.Add(new CategoricalDataPoint(19, "Oct"));
this.radChartView1.Series.Add(lineSeries);
 
LineSeries lineSeries2 = new LineSeries();
lineSeries2.DataPoints.Add(new CategoricalDataPoint(-7, "Jan"));
lineSeries2.DataPoints.Add(new CategoricalDataPoint(15, "Apr"));
lineSeries2.DataPoints.Add(new CategoricalDataPoint(-4, "Jul"));
lineSeries2.DataPoints.Add(new CategoricalDataPoint(22, "Oct"));
this.radChartView1.Series.Add(lineSeries2);
 
CategoricalAxis tempHorizontalAxis = lineSeries.HorizontalAxis as CategoricalAxis;
tempHorizontalAxis.StartPositionAxis = lineSeries.VerticalAxis;
tempHorizontalAxis.StartPositionValue = 0;



However, if it is not the exact requirement please specify in details what is the goal that you are trying to achieve. Thus, we would be able to think about a suitable solution and assist you further.

I hope this information helps. Should you have further questions I would be glad to help.
 
Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
ChartView
Asked by
Holger
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or