From 03ebf81c360e429ef1e4f8bae48fe524f712589a Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Thu, 3 Dec 2009 19:31:08 +0100 Subject: Hover text for event-style graphs Don't draw the data value for an event; only display it in hover text. * grapher/Graph.hxx (window2GraphCoords): new function * grapher/Graph.cxx (window2GraphCoords): ditto * grapher/GraphStyle.cxx (GraphStyleEvent::dataIndexAtPoint): new function implementation. --- grapher/Graph.cxx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'grapher/Graph.cxx') diff --git a/grapher/Graph.cxx b/grapher/Graph.cxx index 55ffcdf2..57f1dc9a 100644 --- a/grapher/Graph.cxx +++ b/grapher/Graph.cxx @@ -205,4 +205,11 @@ namespace systemtap return (_left + (_right - _left) * ((x - _xOffset)/(_zoomFactor * _graphWidth))); } + + void Graph::window2GraphCoords(double x, double y, + double& xgraph, double& ygraph) + { + xgraph = x -_xOffset; + ygraph = -y + _yOffset + _graphHeight; + } } -- cgit