Setting the axis range


Author
Message
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
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


cho seongho
cho seongho
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
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();


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search