Author |
Topic  |
|
oliversleep
35 Posts |
Posted - 16 Feb 2011 : 05:15:11
|
Hi,
I'm currently looking for a solution to display a Marker object without updating all the graph. I would like to update only my marker position. If I would like to call the marker.Draw method, I don't have the current Graphics object.
The reversible marker is not a good solution, because if another windows appear in front of my graph, when I go back to my graph, this marker disapear, and we don't find good solution to know if the marker is visible or not.
|
|
quinncurtis
1164 Posts |
Posted - 16 Feb 2011 : 09:41:49
|
You can try this. You get a temporary graphics object from your ChartView derived window.
Graphics g2 = this.CreateGraphics(); marker.Draw(g2); g2.Dispose();
It must be disposed of immediately after use, as above. |
 |
|
oliversleep
35 Posts |
Posted - 16 Feb 2011 : 10:34:17
|
We try your solution, but it doesn't work like we want.
The marker doesn't disapear when I click on another position. The new marker appears at the new position, and finally I have 2 markers on my graph. And with multiple click, I have multiple markers on my graph.
We try to change the color of the marker before changing the position, but Transparent color doesn't work. If we use background color it erases a part of our scopes.
Perhaps there is another object to do what we want : Show a persistent vertical marker, and when we click somewhere on the graph the marker position will be updated to this location. And we wouldn't like to refresh all the graph, only the marker.
Thanks for your feed back. |
 |
|
quinncurtis
1164 Posts |
Posted - 16 Feb 2011 : 10:48:30
|
What you describe is what we would expect to happen. We don't recommend programmers call the Draw method of the chart objects directly because 9 times out of 10 it does not do what they want.
Our only suggestion is to use the ChartView's updateDraw method, and redraw the entire graph instead. You do not explain why that is unacceptable in your application. We have found through long experience that the only way to maintain the proper drawing order (z-order) of an unlimited number of chart objects, organized by programmers in ways we cannot predict, is to redraw the entire graph from scratch. |
 |
|
oliversleep
35 Posts |
Posted - 16 Feb 2011 : 10:56:23
|
Our problem with the UpdateDraw method is the refresh execution delay.
We have to refresh at the same time : 10 graphs, with 10 curves on each and 500 000 points on each. So the update draw is long. So we are searching for another solution. |
 |
|
quinncurtis
1164 Posts |
Posted - 16 Feb 2011 : 12:01:54
|
Your extreme data requirements make it sound like this is some sort of engine test application: is that the case?
You do not say whether or not you are using data compression.
If not, the first thing I would suggest is that you lower the data requirements. Plotting 500K points/trace on a screen with a horizontal resolution of 1000-2000 pixels is a waste of CPU time. Every horizontal pixel location is being hit 500 times. Turn on each datasets auto-compression mode:
Dataset1.AutoDataCompressEnable = true;
That may well speed up your drawing 50X.
|
 |
|
|
Topic  |
|