Axis Crossing

2 posts, 0 answers
  1. Holger
    Holger avatar
    39 posts
    Member since:
    Jan 2015

    Posted 14 Jan 2018 Link to this post

    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 ?

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3903 posts

    Posted 16 Jan 2018 Link to this post

    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.
Back to Top