From bb91631807ad833a92d011895ad7ca1872e02745 Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Wed, 29 Jul 2009 13:11:10 +0200 Subject: Draw multiple graphs * grapher/Graph.cxx (Graph constructor): Initialize graph dimensions. (draw): Don't clear the drawing area. * grapher/GraphWidget.hxx (GraphWidget): Add dimensions and on_size_request() method. * grapher/GraphWidget.cxx (GraphWidget constructor): Initialize dimensions. (addGraph): New method. (on_size_request): New method to pass widget's size to parent widgets * grapher/grapher.cxx (GrapherWindow constructor): add "add graph" action. (addGraph): New method. --- grapher/Graph.cxx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'grapher/Graph.cxx') diff --git a/grapher/Graph.cxx b/grapher/Graph.cxx index e1ea01f6..7f9b2607 100644 --- a/grapher/Graph.cxx +++ b/grapher/Graph.cxx @@ -10,7 +10,8 @@ namespace systemtap using namespace std::tr1; Graph::Graph(double x, double y) - : _graphX(0), _graphY(0), + : _width(600), _height(200), _graphX(0), _graphY(0), + _graphWidth(580), _graphHeight(180), _lineWidth(2), _autoScaling(true), _autoScrolling(true), _zoomFactor(1.0), _playButton(new CairoPlayButton), _left(0.0), _right(1.0), _top(5.0), _bottom(0.0) @@ -78,10 +79,6 @@ namespace systemtap double horizScale = _zoomFactor * _graphWidth / ( _right - _left); cr->translate(20.0, 0.0); cr->set_line_width(_lineWidth); - cr->save(); - cr->set_source_rgba(0.0, 0.0, 0.0, 1.0); - cr->paint(); - cr->restore(); for (DatasetList::iterator itr = _datasets.begin(), e = _datasets.end(); itr != e; -- cgit