Chart scrollbar not working


Author
Message
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'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.


Replies
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 your solution well. Thank you.
I have additional questions.
The current method does not work if I use a DateTime with an X axis value.
I want to use DateTime as the X axis value.
I also want to set a specific range when using DateTime like the above answer.

please answer about my question. Thank you.
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,
The code above will work if the axis is date time - the only difference between handling double and date time is that when you pass date time values to the control you need to convert them to double using the ToOADate() method - for example:
someDateTime.ToOADate();
return the double equivalent of the the date time object, similarly:
DateTime.FromOADate(someDouble);
return the date time equivalent of the passed double value.
Hope this helps - let us know if you meet any problems.

Best Regards,
Nevron Support Team


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