Skip to content

Commit

Permalink
- Do not align the axes until we have a new implementation of scale e…
Browse files Browse the repository at this point in the history
…ngine.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@20797 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed May 23, 2014
1 parent 38d5152 commit 7daf95e
Show file tree
Hide file tree
Showing 3 changed files with 231 additions and 149 deletions.
13 changes: 10 additions & 3 deletions OMPlot/OMPlotGUI/Plot.cpp
Expand Up @@ -34,6 +34,7 @@
#include "PlotWindow.h"
#include "ScaleDraw.h"
#include "qwt_plot_canvas.h"
#include "qwt_scale_widget.h"
#if QWT_VERSION < 0x060000
#include "qwt_legend_item.h"
#endif
Expand Down Expand Up @@ -71,9 +72,15 @@ Plot::Plot(PlotWindow *pParent)
Move the canvas little bit from bottom and left to align the axis at starting point.
There is a slight margin in the axis drawn so we have to subclass QwtScaleDraw to draw the backbone line and ticks at the proper location.
*/
canvas()->setContentsMargins(-5, 0, 0, -5);
setAxisScaleDraw(QwtPlot::yLeft, new ScaleDraw);
setAxisScaleDraw(QwtPlot::xBottom, new ScaleDraw);
// canvas()->setContentsMargins(-5, 0, 0, -5);
// setAxisScaleDraw(QwtPlot::yLeft, new ScaleDraw);
// setAxisScaleDraw(QwtPlot::xBottom, new ScaleDraw);
/*
The above code doesn't work as expected. The values drawn at 0 are not shown if we align the axis.
We need to reimplement the scale engine.
*/
axisWidget(QwtPlot::yLeft)->setMargin(0);
axisWidget(QwtPlot::xBottom)->setMargin(0);
#endif
// fill colors list
fillColorsList();
Expand Down

0 comments on commit 7daf95e

Please sign in to comment.