I have created two cursors in following Order in my WPF application. (Please find Attachment)
1. Orange (With Larger height)
2. Green (With Shorter Height)
When Super imposing both on same value.
Green Cursor appears on top. But when I tried to grab the green cursor from green area, Orange cursor is getting grabbed.
I am expecting to grab Green cursor, because it appears on the top.
Is there is any property which i am missing to set for cursor or it is a bug in T chart?
Regards,
Rajesh Dhiman
Super imposing Cursors
-
- Newbie
- Posts: 15
- Joined: Mon Sep 15, 2008 12:00 am
Super imposing Cursors
- Attachments
-
- Cursors.PNG (35.63 KiB) Viewed 3113 times
Re: Super imposing Cursors
Hello Rajesh Dhiman,
The problem is that both the drawing process and the tools events handle follow the same order in the tools list. That means that having two cursors, the second will be drawn over the first, but the first will have priority when dragging.
To avoid this, you could use OnChange cursors event to deactivate all the cursors in the same position than the cursor that is actually moving. For example, assigning the following event to both cursors:
The problem is that both the drawing process and the tools events handle follow the same order in the tools list. That means that having two cursors, the second will be drawn over the first, but the first will have priority when dragging.
To avoid this, you could use OnChange cursors event to deactivate all the cursors in the same position than the cursor that is actually moving. For example, assigning the following event to both cursors:
Code: Select all
void cursor_Change(object sender, Steema.TeeChart.Tools.CursorChangeEventArgs e)
{
for (int i = tChart1.Tools.Count - 1; i >= 0; i--)
{
if (tChart1.Tools[i] is Steema.TeeChart.Tools.CursorTool)
{
if ((tChart1.Tools[i] != sender) && (((Steema.TeeChart.Tools.CursorTool)tChart1.Tools[i]).XValue == e.XValue))
{
tChart1.Tools[i].Active = false;
}
else
{
tChart1.Tools[i].Active = true;
}
}
}
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Newbie
- Posts: 15
- Joined: Mon Sep 15, 2008 12:00 am
Re: Super imposing Cursors
Hi Yerey,
Business req doesnot allow me to deactivate any of the cursor..
What to do now?
Rajesh
Business req doesnot allow me to deactivate any of the cursor..
What to do now?
Rajesh
Re: Super imposing Cursors
Hi Rajesh,
Another possibility could be changing the color of the series that is drawn over the first series assigning the same color. Then the second cursor will still be shown, but it will have the color of the first, giving the effect that the first cursor is on top.
Another possibility could be changing the color of the series that is drawn over the first series assigning the same color. Then the second cursor will still be shown, but it will have the color of the first, giving the effect that the first cursor is on top.
Code: Select all
void cursor1_Change(object sender, Steema.TeeChart.Tools.CursorChangeEventArgs e)
{
for (int i = tChart1.Tools.Count - 1; i >= 0; i--)
{
if (tChart1.Tools[i] is Steema.TeeChart.Tools.CursorTool)
{
if ((tChart1.Tools[i] != sender) && (((Steema.TeeChart.Tools.CursorTool)tChart1.Tools[i]).XValue == e.XValue))
{
((Steema.TeeChart.Tools.CursorTool)tChart1.Tools[i]).Pen.Color = ((Steema.TeeChart.Tools.CursorTool)sender).Pen.Color;
}
else
{
((Steema.TeeChart.Tools.CursorTool)tChart1.Tools[i]).Pen.Color = cursorColor[i];
}
}
}
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |