How can I show dynamic markers in DevExpress XtraCharts?
I am using the DevExpress.XtraCharts.SwiftPlotDiagram to show a diagram in my WinForms c# application.
I would like to show a dynamic marker on the series' line, kind of like you have in Google Finance: a simple dot or circle on the line that follows your mouse movement on the series' line.
It appears 开发者_开发知识库to me that DevExpress does not support it. It only allows you to add static markers.
So I was looking for ways of doing it myself. One idea was to simply put an image on top of the series that I move along with the X position of the mouse. This works fine for rectangular shaped markers but not for round shaped markers as it seems that DevExpress does not draw transparant pixels in the image actually transparant. They automatically get the background color of the chart. Does anyone know the reason why it doesn't draw those pixels transparantly or have another idea on how to implement a dynamic marker?
So for the first part we have a support doc that shows how to make the cross-hair type lines seen here: http://www.devexpress.com/Support/Center/kb/p/K18053.aspx (basically using constant lines to that update with mouse move)
And the second part use an image annotation with the background set to Color.Transparent (annotation.BackColor = Color.Transparent). Also for your image use a PNG file (since they easily support transparencies).
Let me know if you need anything else!
-Bryan Wood - DevExpress Charting Evangelist
Currently the XtraCharts control doesn't provide the 'cross-hair cursor' functionality out-of-the box. But we've prepared a complete code sample in our Code Central that implements this functionality to you.
Please, review it and let us know what you think.
http://www.visiblox.com/ is a good alternative, but only for WPF, not .NET 2.0
精彩评论