Zedgraph tooltip formatting

I want to format the tooltip that I used to display the graph and point information in PointValueEvent on Zedgraph.

I know how to format a regular tool, but in this case zedgraph does not have a tooltip property. The value value event automatically displays the tooltip.

How to form this hint?

+4
source share
1 answer

There are several ways to do this.

Option 1 is to use the TagPair Tag property when setting up your data. If the tag is a string, it will be displayed as a hint for the point.

PointPair pp = new PointPair(....); pp.Tag = "This is a custom tooltip"; 

Option 2 is to subscribe to a PointValueEvent graph control and provide a custom value in the event handler.

 graph.PointValueEvent += OnPointValueRequested; ... private string OnPointValueRequested(object sender, GraphPane pane, CurveItem curve, int pointIndex) { PointPair point= curve[pointIndex]; string tooltip = String.Format("({0}, {1})", point.X point.Y); return tooltip; } 

Also keep in mind that there is a bug with using tooltips in Vista and above. You may need to fix your copy of ZedGraph to fix it if you haven't already.

+6
source

All Articles