From ae0d2f2e9f68e22fdc3bc7bb9c830ebfa89305e4 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Fri, 27 Mar 2015 19:26:47 +0000 Subject: [PATCH] Increase color support in Plots --- app/PlotSubWindow.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/PlotSubWindow.cpp b/app/PlotSubWindow.cpp index de4f604..37bcdb3 100644 --- a/app/PlotSubWindow.cpp +++ b/app/PlotSubWindow.cpp @@ -35,6 +35,10 @@ Void PlotSubWindow::definePlotColors() m_arrayColorList.append( Qt::green ); m_arrayColorList.append( Qt::black ); m_arrayColorList.append( Qt::cyan ); + m_arrayColorList.append( Qt::magenta ); + m_arrayColorList.append( Qt::yellow ); + m_arrayColorList.append( Qt::gray ); + m_arrayColorList.append( Qt::darkRed ); } PlotSubWindow::PlotSubWindow( QWidget * parent, const QString& windowTitle ) : @@ -205,7 +209,12 @@ Void PlotSubWindow::setAxisRange( PlotSubWindow::Axis eAxis, const Int& axisStar Void PlotSubWindow::addPlot( const QVector &arrayX, const QVector &arrayY, const QString& key ) { QCPGraph *newPlot = m_cPlotArea->addGraph(); - m_cPlotPen.setColor( m_arrayColorList.at( m_uiNumberPlots ) ); + QColor plotColor = m_arrayColorList.at( 0 ); + if( m_uiNumberPlots < m_arrayColorList.size() ) + { + plotColor = m_arrayColorList.at( m_uiNumberPlots ); + } + m_cPlotPen.setColor( plotColor ); newPlot->setPen( m_cPlotPen ); // line style // pass data points to graphs: newPlot->setData( arrayX, arrayY );