Hi.
I'm working with vb net.
I get a graph like the attached (1.png). I zoom until I can see the point I want (2.png), but after that it takes for ever to reach the last point on the right by dragging with right click. And It is not functional for my application. Is it possible to include scroll bars (vertical and horizontal) in a graph?
And I also lose the axis ticks, Is it possible to redraw them every time I zoom?
Thanks in advance for your help.
Scroll bar in a chart
Scroll bar in a chart
- Attachments
-
- 2.png (9.92 KiB) Viewed 10752 times
-
- 1.png (23.71 KiB) Viewed 10753 times
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Scroll bar in a chart
Hello Paola,
Would you please be so kind as to post a "Short, Self Contained, Correct (Compilable), Example" with which I can reproduce your issue here?Paola wrote:I get a graph like the attached (1.png). I zoom until I can see the point I want (2.png), but after that it takes for ever to reach the last point on the right by dragging with right click. And It is not functional for my application. Is it possible to include scroll bars (vertical and horizontal) in a graph?
And I also lose the axis ticks, Is it possible to redraw them every time I zoom?
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Scroll bar in a chart
Hi
I attached my example. (I had to omit the teechart.dll file because of the size...).
Some of the points of the graph are really close and they look overlaped, so I have to zoom-in them in order to check them correctly. But I need a scrollbar in order to check, quickly on the graph , other points in the limits (such as point d-28) ... besides I can not use right mouse bottom to drag and get that point, because I need right clic for a context menu strip
I want some scrollbars as drawn in 3.png. Is it possible?
Thanks in advance.
I attached my example. (I had to omit the teechart.dll file because of the size...).
Some of the points of the graph are really close and they look overlaped, so I have to zoom-in them in order to check them correctly. But I need a scrollbar in order to check, quickly on the graph , other points in the limits (such as point d-28) ... besides I can not use right mouse bottom to drag and get that point, because I need right clic for a context menu strip
I want some scrollbars as drawn in 3.png. Is it possible?
Thanks in advance.
- Attachments
-
- Ejemplo (2).zip
- Example
- (203.2 KiB) Downloaded 852 times
-
- 3.png (33.67 KiB) Viewed 10738 times
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Scroll bar in a chart
Paola,
Yes, I think so. Please find following a code example in C# - apologies for not writing it in VB.NET, but I am not so proficient in that language. If you need help in porting from C# to VB.NET, please let me know.Paola wrote: I want some scrollbars as drawn in 3.png. Is it possible?
Code: Select all
HScrollBar scrollBar;
private void InitializeChart()
{
scrollBar = new HScrollBar();
scrollBar.Dock = DockStyle.Bottom;
tChart1.Controls.Add(scrollBar);
scrollBar.Visible = false;
scrollBar.Scroll += ScrollBar_Scroll;
tChart1.Aspect.View3D = false;
tChart1.Series.Add(typeof(Line)).FillSampleValues(200);
tChart1.Zoom.Direction = ZoomDirections.Horizontal;
tChart1.Zoomed += TChart1_Zoomed;
tChart1.UndoneZoom += TChart1_UndoneZoom;
}
private void TChart1_UndoneZoom(object sender, EventArgs e)
{
scrollBar.Visible = false;
}
private void ScrollBar_Scroll(object sender, ScrollEventArgs e)
{
double maxDiff = tChart1.Axes.Bottom.Maximum - tChart1.Axes.Bottom.Minimum;
tChart1.Axes.Bottom.Minimum = e.NewValue;
tChart1.Axes.Bottom.Maximum = e.NewValue + maxDiff;
}
private void TChart1_Zoomed(object sender, EventArgs e)
{
double maxDiff = tChart1.Axes.Bottom.Maximum - tChart1.Axes.Bottom.Minimum;
scrollBar.Visible = true;
scrollBar.Minimum = Utils.Round(tChart1[0].XValues.Minimum);
scrollBar.Maximum = Utils.Round(tChart1[0].XValues.Maximum - maxDiff);
scrollBar.Value = Utils.Round(tChart1.Axes.Bottom.Minimum + (maxDiff / 2));
scrollBar.LargeChange = Utils.Round(tChart1.Axes.Bottom.Increment);
}
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Scroll bar in a chart
Thank you very much.. It was very useful.