Chart Tools
-
- Advanced
- Posts: 192
- Joined: Thu Feb 01, 2007 12:00 am
- Contact:
Chart Tools
The Chart Editor at design time allows you to add muliple tools. I have reviewed the tutorial which explains very well what each tool does and how to add the tool using the Chart Editor or via code.
The one thing that is missing and that is confusing, how do you manage more than one tool that has been added?
The Chart Editor and via code, I can add one of each tool to the chart. There is nothing that shows me how to switch between the tools.
I have also noticed that I can add more than one tool of the same type. Nothing prevents me from doing this. Shouldn't that be disallowed? What use is there for lets say 3 Rotate tools?
These tools that I can add via the Chart Editor how are they different from the Commander control or ChartController control. There appears to be very little documentation on when and where to use each of these tools and controls. Can someone direct me to something that shows me how to use these, especially the new ChartController control?
The one thing that is missing and that is confusing, how do you manage more than one tool that has been added?
The Chart Editor and via code, I can add one of each tool to the chart. There is nothing that shows me how to switch between the tools.
I have also noticed that I can add more than one tool of the same type. Nothing prevents me from doing this. Shouldn't that be disallowed? What use is there for lets say 3 Rotate tools?
These tools that I can add via the Chart Editor how are they different from the Commander control or ChartController control. There appears to be very little documentation on when and where to use each of these tools and controls. Can someone direct me to something that shows me how to use these, especially the new ChartController control?
Hi Mike
You can access to the tools with an index, the first tool that you add will be number 0, the second will be number 1... If you add tools in design time and run time, the tools which have added in design time will be the first and run time the seconds. Also you can control the type of the tool, please see the below code:
If you have more than one tool of the same type, you should to know the order which are added.
The ChartController has the same functionality that the Commander. The ChartController is derived of new class to .net framework 2.0, so it's only for the version compiled with V.S. 2005.
You can access to the tools with an index, the first tool that you add will be number 0, the second will be number 1... If you add tools in design time and run time, the tools which have added in design time will be the first and run time the seconds. Also you can control the type of the tool, please see the below code:
Code: Select all
line1.FillSampleValues();
//I have added some tools in design time.
Steema.TeeChart.Tools.AxisScroll AxisScroll1 = new Steema.TeeChart.Tools.AxisScroll(tChart1.Chart);
AxisScroll1.Axis = tChart1.Axes.Left;
for (int i = 0; i < tChart1.Tools.Count; i++)
{
Steema.TeeChart.Tools.Tool t = tChart1.Tools[i]; //Acces to the tools with the index.
if (t is Steema.TeeChart.Tools.ColorLine) //You can know which type is it.
listBox1.Items.Add("Tool number "+i.ToString() + " is a colorLine tool");
else
listBox1.Items.Add(i.ToString()+" "+t.ToString());
}
The ChartController has the same functionality that the Commander. The ChartController is derived of new class to .net framework 2.0, so it's only for the version compiled with V.S. 2005.
-
- Advanced
- Posts: 192
- Joined: Thu Feb 01, 2007 12:00 am
- Contact:
Using ChartController
Several issues I am working:
1. At design time, the control allows you to add buttons to the ChartControllers Toolbar. By clicking on the button provided by the base class, System.Windows.Forms.ToolStrip, you can add a Button, Lable, SplitButton, DropDownButton, Separator, ComboBox, TextBox, ProgressBar.
See: http://webpages.charter.net/jonesboy/Ch ... roller.JPG
Unfortunately there appears to be a bug. If you navigate away from the designer and then come back to the ChartController the new button is no longer visible. The code appears to be added to the form.designer.cs file.
2. How can I remove a standard button either programatically or at design time that is in the ChartController? for example, the behavior of the move button does suit our needs so I would like to remove it. Right clicking on the ChartController in the designer, and selecting "Edit Items" and removing the control does not seem to work.
3. What does the Depth button do? It appears to have no implementation. When I click on it, nothing happens. Where other buttons will perform actions.
4. What does the Normal button do? It appears to have no implementation. When I click on it, nothing happens. Where other buttons will perform actions.
5. Noticed when I set the ChartController.LabelValues = false at design time, This value was never written into the Form1.designer.cs. I had to add code to do this in my Form1.cs file.
1. At design time, the control allows you to add buttons to the ChartControllers Toolbar. By clicking on the button provided by the base class, System.Windows.Forms.ToolStrip, you can add a Button, Lable, SplitButton, DropDownButton, Separator, ComboBox, TextBox, ProgressBar.
See: http://webpages.charter.net/jonesboy/Ch ... roller.JPG
Unfortunately there appears to be a bug. If you navigate away from the designer and then come back to the ChartController the new button is no longer visible. The code appears to be added to the form.designer.cs file.
2. How can I remove a standard button either programatically or at design time that is in the ChartController? for example, the behavior of the move button does suit our needs so I would like to remove it. Right clicking on the ChartController in the designer, and selecting "Edit Items" and removing the control does not seem to work.
3. What does the Depth button do? It appears to have no implementation. When I click on it, nothing happens. Where other buttons will perform actions.
4. What does the Normal button do? It appears to have no implementation. When I click on it, nothing happens. Where other buttons will perform actions.
5. Noticed when I set the ChartController.LabelValues = false at design time, This value was never written into the Form1.designer.cs. I had to add code to do this in my Form1.cs file.
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hello,
From this post:
http://www.teechart.net/support/viewtopic.php?t=6272
You will be able to see how to change/add/remove items from the ChartController at runtime. You will also see that, at the moment, the design experience of the ChartController is not optimal and will be looked at in a future release.
The Depth button enables the depth of a 3D chart to be changed by dragging the mouse over the chart. The Normal button returns the chart's mouse behaviour to the standard behaviour.
From this post:
http://www.teechart.net/support/viewtopic.php?t=6272
You will be able to see how to change/add/remove items from the ChartController at runtime. You will also see that, at the moment, the design experience of the ChartController is not optimal and will be looked at in a future release.
The Depth button enables the depth of a 3D chart to be changed by dragging the mouse over the chart. The Normal button returns the chart's mouse behaviour to the standard behaviour.
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
-
- Advanced
- Posts: 192
- Joined: Thu Feb 01, 2007 12:00 am
- Contact:
Confused how to use a tool
I am still baffled at how to make use of a tool such as AxisScroll. I have a chart that contains a series. I open up the Chart Editor and go to the "Tools" tab. I add the Axis Scroll Tool and set the Axis = Left Axis.
Now what? I close the editor and have no idea how to us the Axis Scroll tool. I click on the left mouse button and drag it id different ways and can't seem to get away from the "normal" mouse behavior. It wants to draw a rectangle to zoom. What am I doing wrong? I have looked through documentation, searched this forum, I have looked through the Chart Example demo code and can't find a good example of how to use the control at run time or during design time.
Now what? I close the editor and have no idea how to us the Axis Scroll tool. I click on the left mouse button and drag it id different ways and can't seem to get away from the "normal" mouse behavior. It wants to draw a rectangle to zoom. What am I doing wrong? I have looked through documentation, searched this forum, I have looked through the Chart Example demo code and can't find a good example of how to use the control at run time or during design time.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Mike,
With Axis Scroll Tool you just need to place the mouse over the axis line and drag it to scroll the axis.
With Axis Scroll Tool you just need to place the mouse over the axis line and drag it to scroll the axis.
Best Regards,
Narcís Calvet / 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 |
-
- Advanced
- Posts: 192
- Joined: Thu Feb 01, 2007 12:00 am
- Contact:
After further investigation
I was able to figure out how to use the Axis Scroll Tool. I must say it was not very intuitive.
I would like to implement what the right mouse button does when in normal mode, except I want to do it with the left mouse button. Ideally I would have a button on chartcontroller tool bar that would initiate the mode. The mouse cursor would change to a hand (like the axis scroll does when I mouse over the axis). Then I could drag from the middle of a chart any direction I want to scroll.
Researching, this seems like it is difficult to do because of the default "Normal" behavior of the mouse down, mouse up events.
1. Is there an easy way to turn off the "Normal" mouse handling?
2. Is there an easy way to effectively do what the right mouse/drag does using the left mouse and drag?
I would like to implement what the right mouse button does when in normal mode, except I want to do it with the left mouse button. Ideally I would have a button on chartcontroller tool bar that would initiate the mode. The mouse cursor would change to a hand (like the axis scroll does when I mouse over the axis). Then I could drag from the middle of a chart any direction I want to scroll.
Researching, this seems like it is difficult to do because of the default "Normal" behavior of the mouse down, mouse up events.
1. Is there an easy way to turn off the "Normal" mouse handling?
2. Is there an easy way to effectively do what the right mouse/drag does using the left mouse and drag?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Mike,
If I understood well what are you trying to achieve, this is pretty easy. You can set up which button you want to for panning and zooming. You can do that openning the chart editor and going to the General tab. You can also do it at run-time as shown in the code snippet below. Also notice that when the mouse button set for scrolling is pressed the cursor is set to Hand and back to Default when released.
You can also customize ChartControler as shown at All Features\Welcome !\Components\ChartController examples in the features demo, which can be found at TeeChart's program group.
If I understood well what are you trying to achieve, this is pretty easy. You can set up which button you want to for panning and zooming. You can do that openning the chart editor and going to the General tab. You can also do it at run-time as shown in the code snippet below. Also notice that when the mouse button set for scrolling is pressed the cursor is set to Hand and back to Default when released.
Code: Select all
private void Form1_Load(object sender, EventArgs e)
{
line1.FillSampleValues();
tChart1.Zoom.MouseButton = MouseButtons.Right;
tChart1.Panning.MouseButton = MouseButtons.Left;
}
private void tChart1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == tChart1.Panning.MouseButton)
{
tChart1.Cursor = System.Windows.Forms.Cursors.Hand;
}
}
private void tChart1_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == tChart1.Panning.MouseButton)
{
tChart1.Cursor = System.Windows.Forms.Cursors.Default;
}
}
Best Regards,
Narcís Calvet / 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 |
-
- Advanced
- Posts: 192
- Joined: Thu Feb 01, 2007 12:00 am
- Contact:
Perfect!!!!
That works great.
There are so many facets to the TeeChart control. It is difficult to sometimes find the best approach to designing with it.
I am having problems getting the mouse cursor to change, but it is likely a problem on my end.
thanks
There are so many facets to the TeeChart control. It is difficult to sometimes find the best approach to designing with it.
I am having problems getting the mouse cursor to change, but it is likely a problem on my end.
thanks
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Mike,
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
I'm glad to hear that.That works great.
Yes, having a look at the features demo an tutorials available at TeeChart's program group can be a very good starting point.There are so many facets to the TeeChart control. It is difficult to sometimes find the best approach to designing with it.
Ok, if the problem persists please send us a simple example project we can run "as-is" to reproduce the problem here.I am having problems getting the mouse cursor to change, but it is likely a problem on my end.
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
Best Regards,
Narcís Calvet / 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 |