After plotting the graph I "hand" move some of the Marks around using the DragMarks tool. The Marks also have the arrows turned on, and a color assigned to the line.
After zooming in, or out, the connecting lines no longer are correct.
mySeries.Marks.Arrow.Visible = true;
mySeries.Marks.Arrow.Color = System.Drawing.Color.DarkGray;
Mark Position not correct after zoom?
Hi.
This is as designed. Customer positions (for series marks and also for other objects on chart) are always expressed in screen pixel coordinates. When you, for example, move the mark to screen point (100,100), it will stay there even if you scroll, zoom, export to image, print .... chart.
A solution to your problem is to express custom position in (real) axis coordinates and then in one of chart or series events adjust custom position according to this (saved) real position. Basically, do the following:
1) When you initially move series mark, transform it's position from screen coordinates to axis coordinates. You can use axis CalcPosPoint method to do this.
2) Later in one of chart evens, use these saved values to reposition series mark(s). You can use chart axis CalcPosValue method to transform from real back to screen coordinates.
Using this approach mark position will be adjusted if you zoom scroll and even print chart.
This is as designed. Customer positions (for series marks and also for other objects on chart) are always expressed in screen pixel coordinates. When you, for example, move the mark to screen point (100,100), it will stay there even if you scroll, zoom, export to image, print .... chart.
A solution to your problem is to express custom position in (real) axis coordinates and then in one of chart or series events adjust custom position according to this (saved) real position. Basically, do the following:
1) When you initially move series mark, transform it's position from screen coordinates to axis coordinates. You can use axis CalcPosPoint method to do this.
2) Later in one of chart evens, use these saved values to reposition series mark(s). You can use chart axis CalcPosValue method to transform from real back to screen coordinates.
Using this approach mark position will be adjusted if you zoom scroll and even print chart.
Marjan Slatinek,
http://www.steema.com
http://www.steema.com
Hi.
This falls into the same category. When you drag marks around, you're defining their custom position (expressed in screen pixels). And when you resize chart/form, mark positions are not updated (see my first reply in this thread).Also, I seem to have another problem. If the chart is resized (ie. docking it to all corners), the marks are also incorrect.
Last edited by Marjan on Mon Feb 09, 2004 10:15 pm, edited 1 time in total.
Marjan Slatinek,
http://www.steema.com
http://www.steema.com
Sure. You could use one of chart or series event to check mark custom positions and then later in chart OnAfterDraw event do the adjustments. For example, you could use series AfterDrawValues event to cycle through all series marks and if mark position is customized, to the translation and store it in array (or collection, list, ...). Then in chart OnAfterDraw event do the reverse thing (see my original reply in this thread).8123490 wrote:I cannot find a public event for tracking the mouse movement in the DragMarks class. Without that, is there another way of implementing a click-and-drag action for a mark?
Marjan Slatinek,
http://www.steema.com
http://www.steema.com
I can understand why the Mark would be implemented using screen coordinates, but my concern is with the connecting line. It seems to be rendered using screen coordinates as well.
I have the following questions about your implementation:
- How do I know that the mark has been customized?
- How to I make the connecting line connect properly?
I have the following questions about your implementation:
- How do I know that the mark has been customized?
- How to I make the connecting line connect properly?