From 572a176d481c329b370ce52e7bec1a49ed76c225 Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Tue, 1 Dec 2009 12:02:24 +0100 Subject: change time type from double to int64_t * grapher/Graph.hxx (Graph): Change variables holding the time limits of the displayed graph from double to int64_t. * grapher/Graph.cxx (Graph::draw): Do calculations of time differences using int64_t. (Graph::getExtents, Graph::setExtents): Change left and right arguments to int64_t. * grapher/GraphData.hxx (GraphDataBase): Change time type to int64_t. (GraphDataBase::elementAsString): New function. (GraphData::elementAsString): Implementation of that function. * grapher/StapParser.cxx (parseData): Parse time values from the stap script as 64 bit values. --- grapher/Graph.hxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'grapher/Graph.hxx') diff --git a/grapher/Graph.hxx b/grapher/Graph.hxx index aad63767..e0e864d6 100644 --- a/grapher/Graph.hxx +++ b/grapher/Graph.hxx @@ -11,6 +11,7 @@ namespace systemtap class Graph : public CairoWidget { public: + typedef std::vector > DatasetList; friend class GraphWidget; Graph(double x = 0.0, double y = 0.0); virtual void draw(Cairo::RefPtr cr); @@ -20,9 +21,9 @@ namespace systemtap bool getAutoScaling() const { return _autoScaling; } void setAutoScaling(bool val) { _autoScaling = val; } void addGraphData(std::tr1::shared_ptr data); - void getExtents(double& left, double& right, double& top, double& bottom) + void getExtents(int64_t& left, int64_t& right, double& top, double& bottom) const; - void setExtents(double left, double right, double top, double bottom); + void setExtents(int64_t left, int64_t right, double top, double bottom); // extents of the whole graph area double _width; double _height; @@ -36,11 +37,12 @@ namespace systemtap bool _autoScrolling; double _zoomFactor; std::tr1::shared_ptr _playButton; + DatasetList& getDatasets() { return _datasets; } + int64_t getTimeAtPoint(double x); protected: - typedef std::vector > DatasetList; DatasetList _datasets; - double _left; - double _right; + int64_t _left; + int64_t _right; double _top; double _bottom; }; -- cgit From c10fce7d6aaa57a4f94f9d7aeea906597456f7ce Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Wed, 2 Dec 2009 19:27:07 +0100 Subject: 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. --- grapher/Graph.hxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'grapher/Graph.hxx') diff --git a/grapher/Graph.hxx b/grapher/Graph.hxx index e0e864d6..b9efb2a2 100644 --- a/grapher/Graph.hxx +++ b/grapher/Graph.hxx @@ -36,6 +36,8 @@ namespace systemtap bool _autoScaling; bool _autoScrolling; double _zoomFactor; + double _xOffset; + double _yOffset; std::tr1::shared_ptr _playButton; DatasetList& getDatasets() { return _datasets; } int64_t getTimeAtPoint(double x); -- cgit