Profile Picture

Setting the axis range

Posted By cho seongho 5 Years Ago
Author
Message
cho seongho
Question Posted 5 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 15, Visits: 73

I am using a line chart that uses "XValues". I want to display the specific X-axis range I want whenever data is updated. However, when I enter the data, it appears that the range is set to the value of the input data.
In my opinion, it seems that the range beyond the input value is not set.

I implemented it with reference to your sample code but it does not work.The code is shown below.
For example, in the following cases, the X axis range is set from 0 to 40 on the screen, but I want to set it from 0 to 100.

https://www.nevron.com/forum/uploads/images/d386dd31-d038-4d92-b58d-2713.png



NNumericAxisPagingView pagingView = m_chart.Axis(StandardAxis.PrimaryX).PagingView as NNumericAxisPagingView;

pagingView.Begin = xAxis.ContentRange.Begin;
pagingView.Length = 100;

//m_chart.Axis(StandardAxis.PrimaryX).PagingView.ZoomIn(new NRange1DD(xAxis.ContentRange.Begin, 100), 0.1);   This also does not work

nChartControl1.Refresh();



Nevron Support
This post has been flagged as an answer
Posted 5 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 3,039, Visits: 3,746
Hi Cho,
You need to set the axis View - for example:
   NChart chart = nChartControl1.Charts[0];

    NLineSeries line = new NLineSeries();
    chart.Series.Add(line);
    Random rand = new Random();

    line.UseXValues = true;
    line.DataLabelStyle.Visible = false;

    for (int i = 0; i < 40; i++)
    {
      line.Values.Add(rand.Next(100));
      line.XValues.Add(i);
    }

    chart.Axis(StandardAxis.PrimaryX).View = new NRangeAxisView(new NRange1DD(0, 100), true, true);
    chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = new NLinearScaleConfigurator();
this will allow you to set a different range than the one that is automatically calculated based on the chart content. Let us know if you have any questions.



Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic