Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Showing point values by default on ZedGraph

I'm building and displaying a ZedGraph in a WinForm. When I rightclick on the graph, there is an option for "show point values". When that's enabled, hovering over a point will give the X/Y values for that point.

  1. Is there a way to have this enabled by default.
  2. My X-Axis is an XDate. I know how to set the scale format on the X-Axis, but how can I set the format in the tooltip?
like image 922
Stealth Rabbi Avatar asked May 17 '12 16:05

Stealth Rabbi


1 Answers

When your form is initialized, do something like:

var zgc = msGraphControl1.zedGraphControl1;

zgc.IsShowPointValues = true;
zgc.PointValueFormat = "0.000";
zgc.PointDateFormat = "d";

That should do it.

like image 164
Gordon Slysz Avatar answered Nov 01 '22 07:11

Gordon Slysz