diff options
author | Tim Moore <timoore@redhat.com> | 2009-12-02 19:27:07 +0100 |
---|---|---|
committer | Tim Moore <timoore@redhat.com> | 2009-12-02 19:39:37 +0100 |
commit | c10fce7d6aaa57a4f94f9d7aeea906597456f7ce (patch) | |
tree | f518b6a5387c3a015eb1930d44c208ef0b3f7abe /grapher/GraphStyle.hxx | |
parent | 6197b0dc80c4f87000d26213293fe2cb72fbe081 (diff) | |
download | systemtap-steved-c10fce7d6aaa57a4f94f9d7aeea906597456f7ce.tar.gz systemtap-steved-c10fce7d6aaa57a4f94f9d7aeea906597456f7ce.tar.xz systemtap-steved-c10fce7d6aaa57a4f94f9d7aeea906597456f7ce.zip |
Make the hover text conform to data displayed.
Start of code to be more selective about the association between the
hover text and the underling graph. Also, show the data set name in hover text.
* grapher/GraphStyle.hxx (dataIndexAtPoint): New virtual function.
* grapher/GraphStyle.cxx (dataIndexAtPoint): Implementation for bar graphs
* grapher/GraphWidget.cxx (onHoverTimeout): Use dataIndexAtPoint.
Diffstat (limited to 'grapher/GraphStyle.hxx')
-rw-r--r-- | grapher/GraphStyle.hxx | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/grapher/GraphStyle.hxx b/grapher/GraphStyle.hxx index 4a0cd955..9625f451 100644 --- a/grapher/GraphStyle.hxx +++ b/grapher/GraphStyle.hxx @@ -14,29 +14,40 @@ namespace systemtap public: virtual void draw(std::tr1::shared_ptr<GraphDataBase> graphData, Graph* graph, Cairo::RefPtr<Cairo::Context> cr) = 0; + virtual ssize_t dataIndexAtPoint(double x, double y, + std::tr1::shared_ptr<GraphDataBase> + graphData, + std::tr1::shared_ptr<Graph> graph) + { + return -1; + } }; class GraphStyleBar : public GraphStyle { public: - virtual void draw(std::tr1::shared_ptr<GraphDataBase> graphData, - Graph* graph, Cairo::RefPtr<Cairo::Context> cr); + void draw(std::tr1::shared_ptr<GraphDataBase> graphData, + Graph* graph, Cairo::RefPtr<Cairo::Context> cr); + static GraphStyleBar instance; + ssize_t dataIndexAtPoint(double x, double y, + std::tr1::shared_ptr<GraphDataBase> graphData, + std::tr1::shared_ptr<Graph> graph); }; class GraphStyleDot : public GraphStyle { public: - virtual void draw(std::tr1::shared_ptr<GraphDataBase> graphData, - Graph* graph, Cairo::RefPtr<Cairo::Context> cr); + void draw(std::tr1::shared_ptr<GraphDataBase> graphData, + Graph* graph, Cairo::RefPtr<Cairo::Context> cr); static GraphStyleDot instance; }; class GraphStyleEvent : public GraphStyle { public: - virtual void draw(std::tr1::shared_ptr<GraphDataBase> graphData, - Graph* graph, Cairo::RefPtr<Cairo::Context> cr); + void draw(std::tr1::shared_ptr<GraphDataBase> graphData, + Graph* graph, Cairo::RefPtr<Cairo::Context> cr); static GraphStyleEvent instance; }; } |