scrollbar

  • Thread starter Thread starter juli
  • Start date Start date
J

juli

I have a chart with data and I want to add a scroll bar there but to
do a paging - each time I move the scroll bar to add a data (to divife
all the data untill all of it will be presented)
What is the best way to do it?
Thanks a lot!
 
Hello,

Yes, this can be done inserting VS.NET scroll bars to your form and using
"SetMinMax" when creating the form and when scrolling as shown below:

private void Form1_Load(object sender, System.EventArgs e) {
line1.FillSampleValues(200);
tChart1.Axes.Bottom.SetMinMax(0, 20);
}

private void hScrollBar1_Scroll(object sender,
System.Windows.Forms.ScrollEventArgs e) {
tChart1.Axes.Bottom.SetMinMax(0+hScrollBar1.Value, 20+hScrollBar1.Value);
}

After populating your series you can do:

hScrollBar1.Maximum=Convert.ToInt16(tChart1.Series[0].XValues.Maximum);

--
Best Regards,

Narcís Calvet
http://support.steema.com

"Important note: If you are a TeeChart registered customer, please post your
support questions at Steema's Support monitored Forums for customers:
http://support.steema.com for a prompter reply."
 
Hello,

Yes, this can be done inserting VS.NET scroll bars to your form and using
"SetMinMax" when creating the form and when scrolling as shown below:

private void Form1_Load(object sender, System.EventArgs e) {
line1.FillSampleValues(200);
tChart1.Axes.Bottom.SetMinMax(0, 20);
}

private void hScrollBar1_Scroll(object sender,
System.Windows.Forms.ScrollEventArgs e) {
tChart1.Axes.Bottom.SetMinMax(0+hScrollBar1.Value,
20+hScrollBar1.Value);
}

After populating your series you can do:

hScrollBar1.Maximum=Convert.ToInt16(tChart1.Series[0].XValues.Maximum);

Regards,
Narcís.
 
Thank u.
Did something like that but the weired thing is that I have the biggest
value X=22 and the scroll shows axis untill 33,why??(I set maximum of
the scroll to maximum value of x).
How to make it show only untill the last value of x?
 
Hi Juli,

The problem is the SCrollBar.LargeChange property. Setting it to 1 and
subtract the increment you used as the axis maximum to the ScrollBar.Maximum
as shown below.

int ScrollIncrement=25;
this.tChart1.Axes.Bottom.SetMinMax(0,ScrollIncrement);
this.hScrollBar1.LargeChange = 1;
this.hScrollBar1.Maximum=Convert.ToInt16(this.tChart1.Series[0].XValues.Maxi
mum)-ScrollIncrement;

Regards,
Narcís.
 
Back
Top