Group: Forum Members
Last Active: 3 Years Ago
Posts: 15,
Visits: 73
|
I'm implementing a real-time chart, and I'd like to control the scrollbar to show the latest input values.
However, if you use "PagingView" to set the range shown on the screen, and keep typing the value, the scroll bar will always be in the initial position. So I added the code below but it does not do anything. Chart is set to NumericAxisPagingView.
private void Timer_Tick(object sender, EventArgs e) { double y1 = random.NextDouble(); m_lineSeries.XValues.Add(x); m_lineSeries.Values.Add(y1); x += 1.0; nChartControl1.Charts[0].Axis(StandardAxis.PrimaryX).View = new NRangeAxisView(new Nevron.GraphicsCore.NRange1DD(x - 10, x), true, true); //Not work nChartControl1.Charts[0].Axis(StandardAxis.PrimaryX).PagingView.ViewRange = new Nevron.GraphicsCore.NRange1DD(x - 10, x); //Not Work nChartControl1.Charts[0].Axis(StandardAxis.PrimaryX).Pagi ngView.SetRange(new Nevron.GraphicsCore.NRange1DD(x - 10, x), false); //Not Work nChartControl1.Charts[0].Axis(StandardAxis.PrimaryX).PagingView.ScrollToValue(x - 10); //Not Work
nChartControl1.Charts[0].Axis(StandardAxis.PrimaryX).UpdateScale(); nChartControl1.Charts[0].Refresh(); nChartControl1.Refresh(); } I want sample code that can control the scrollbar position with code.
|