cause a line to follow the mouse
cause a line to follow the mouse
hello,
is there a functionallity that allow the mouse to drag a line to a different location on the chart? if so, is there a code sample for it?
is there a functionallity that allow the mouse to drag a line to a different location on the chart? if so, is there a code sample for it?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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 |
drag and drop a bubble..
I am using the above sample to drag a bubble and not a line. Is there a way to show the bubble moving with the mouse cursor until the drop (in transperent way)
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi idan,
If you only want to drag one single bubble you should use DragPoint tool. You'll find an example at All Features\Welcome !\Tools\Drag Point in the features demo, available at TeeChart's program group.
For setting bubble transparency you can do this:
If you only want to drag one single bubble you should use DragPoint tool. You'll find an example at All Features\Welcome !\Tools\Drag Point in the features demo, available at TeeChart's program group.
For setting bubble transparency you can do this:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart1.Zoom.Allow = false;
bubble1 = new Steema.TeeChart.Styles.Bubble(tChart1.Chart);
bubble1.FillSampleValues();
tChart1.MouseUp += new MouseEventHandler(tChart1_MouseUp);
Steema.TeeChart.Tools.DragPoint dragPoint1 = new Steema.TeeChart.Tools.DragPoint(tChart1.Chart);
dragPoint1.Drag += new Steema.TeeChart.Tools.DragPointEventHandler(dragPoint1_Drag);
}
void dragPoint1_Drag(Steema.TeeChart.Tools.DragPoint sender, int index)
{
bubble1.Colors[index] = Color.FromArgb(50, bubble1.Colors[index]);
i = index;
}
private Steema.TeeChart.Styles.Bubble bubble1;
private int i = -1;
private void tChart1_MouseUp(object sender, MouseEventArgs e)
{
bubble1.Colors[i] = Color.FromArgb(0, bubble1.Colors[i]);
i = -1;
}
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 |
great tool.
Can i force the drag to be followed only on the y axis meaning only vertically, and how can i make the bubble transperent during the drag?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi idan,
Yes, set DragPoint tool like this:
Have you tried running the example I posted? It already makes the dragged bubble transparent.
Yes, set DragPoint tool like this:
Code: Select all
dragPoint1.Style = Steema.TeeChart.Tools.DragPointStyles.Y;
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 |
one more question...
i have multiplie series on the chart, and i want to drag only specific graph and not all the series on the chart.
regarding the transperent issue...
i guess it's making it transperent, but it's very hard to see it because the bubble style is polished sphere
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi idan,
You can set DragPoint tool to a specific series:
So that it will only work for this series. Using line above together with the code in my example will only drag bubble1 series.
You can set DragPoint tool to a specific series:
Code: Select all
dragPoint1.Series = bubble1;
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 |
click event is not fired because of dragTool
after adding a drag tool to a series the series click event (only left click, right click fires the event) isn't fired. is that a known issue? is there a way to keep the drag tool and still fire the event?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi idan,
By defaul DragPoint tool uses left mouse button, if you want to use right button you need to do this:
DragPoint tool masks the ClickSeries event. However, you can achieve what you request using MouseDown event like this:
By defaul DragPoint tool uses left mouse button, if you want to use right button you need to do this:
Code: Select all
dragPoint1.Button = MouseButtons.Right;
Code: Select all
void tChart1_MouseDown(object sender, MouseEventArgs e)
{
for (int i = 0; i < tChart1.Series.Count; i++)
{
if (tChart1[i].Clicked(e.X,e.Y) != -1)
{
tChart1.Header.Text = "Series " + i.ToString() + " clicked at point " +
tChart1[i].Clicked(e.X, e.Y).ToString();
}
}
}
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 |
double click event with DragTool
the DragTool masks the double click for a series as well. is there a work around for it also?
one more question for the bubble graph. is there a way to keep the bubble the same size even in zoom events?
one more question for the bubble graph. is there a way to keep the bubble the same size even in zoom events?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi idan,
You can use chart's DoubleClick event like this:the DragTool masks the double click for a series as well. is there a work around for it also?
Code: Select all
void tChart1_DoubleClick(object sender, EventArgs e)
{
for (int i = 0; i < tChart1.Series.Count; i++)
{
if (tChart1[i].Clicked(X, Y) != -1)
{
tChart1.Header.Text = "Series " + i.ToString() + " dblclicked at point " +
tChart1[i].Clicked(X, Y).ToString();
}
}
X = -1;
Y = -1;
}
private int X = -1;
private int Y = -1;
void tChart1_MouseDown(object sender, MouseEventArgs e)
{
X = e.X;
Y = e.Y;
}
I'm not sure about what you exactly mean. However, you could try changing bubbles radius according to the zooming ratio. You could try using the Zoomed and UndoneZoom events for that. Retrieving initial axes min. and max. values before and after zooming will give you the zooming ratio.one more question for the bubble graph. is there a way to keep the bubble the same size even in zoom events?
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 |
keep the bubble the same size even in zoom events
how can i change the radius for a series after calculating the zoom ratio.(I guess you meant the difference between the inital and current axes in the zoomed event...)
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi idan,
Yes, exactly. You can change radius values like this:
Yes, exactly. You can change radius values like this:
Code: Select all
for (int i = 0; i < bubble1.Count; i++)
{
bubble1.RadiusValues[i] *= ratio;
}
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 |