Changeset - da1c905338e1
[Not reviewed]
barplot
0 3 0
Hasan Yavuz Ă–ZDERYA - 8 years ago 2017-10-25 14:35:25
hy@ozderya.net
set y axis of bar plot
3 files changed with 20 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/barplot.cpp
Show inline comments
 
@@ -40,3 +40,15 @@ void BarPlot::update()
 
    barChart.resample();
 
    replot();
 
}
 

	
 
void BarPlot::setYAxis(bool autoScaled, double yMin, double yMax)
 
{
 
    if (autoScaled)
 
    {
 
        setAxisAutoScale(QwtPlot::yLeft);
 
    }
 
    else
 
    {
 
        setAxisScale(QwtPlot::yLeft, yMin, yMax);
 
    }
 
}
src/barplot.h
Show inline comments
 
@@ -32,6 +32,10 @@ class BarPlot : public QwtPlot
 
public:
 
    explicit BarPlot(ChannelManager* channelMan, QWidget* parent = 0);
 

	
 
public slots:
 
    /// Set the Y axis
 
    void setYAxis(bool autoScaled, double yMin = 0, double yMax = 1);
 

	
 
private:
 
    ChannelManager* _channelMan;
 
    BarChart barChart;
src/mainwindow.cpp
Show inline comments
 
@@ -155,6 +155,10 @@ MainWindow::MainWindow(QWidget *parent) 
 
    connect(&plotControlPanel, &PlotControlPanel::plotWidthChanged,
 
            plotMan, &PlotManager::setPlotWidth);
 

	
 
    // secondary (bar) plot signals
 
    connect(&plotControlPanel, &PlotControlPanel::yScaleChanged,
 
            &barPlot, &BarPlot::setYAxis);
 

	
 
    QObject::connect(ui->actionClear, SIGNAL(triggered(bool)),
 
                     this, SLOT(clearPlot()));
 

	
0 comments (0 inline, 0 general)