Hello folks,
I have an histogram having eaxctly 7 balk with the green color for all balk, but i am looking for a way on how to paint (e.g. blue) only and only one balk for a specific reasons. This is important for me in order to show specific details. my code:
QwtPlot plot;
plot.setCanvasBackground(QColor(Qt::black));
plot.setTitle("Histogram: Test Diagram ");
QwtPlotGrid *grid = new QwtPlotGrid;
grid->enableXMin(true);
grid->enableYMin(true);
grid->setMajPen(QPen(Qt::gray, 0, Qt:otLine));
grid->setMinPen(QPen(Qt::gray, 0, Qt:otLine));
grid->attach(&plot);
....
....
....
plot.setAxisTitle(QwtPlot::yLeft, " number ");
plot.setAxisScale(QwtPlot::yLeft, 0.0, DATA_NUMBER);
plot.setAxisTitle(QwtPlot::xBottom, " <- Datatypen -> ");
plot.setAxisScaleDraw(QwtPlot::xBottom, new DataScaleDraw());
plot.setAxisLabelAlignment(QwtPlot::xBottom, Qt::AlignLeft | Qt::AlignBottom);
plot.setAxisScale(QwtPlot::xBottom, 0.0, DATA_TYPE_NUMBER);
plot.setAxisMaxMinor(QwtPlot::xBottom, 0);
Note: DataScaleDraw() is following:
class DataScaleDraw: public QwtScaleDraw
{
public:
DataScaleDraw()
{
}
virtual QwtText label(double v) const
{
switch (int(v))
{ case 1: return QString(" PP "); break;
case 2: return QString(" AP "); break;
case 3: return QString(" PM "); break;
case 4: return QString(" FM "); break;
case 5: return QString(" DD "); break;
case 6: return QString(" SS "); break;
case 7: return QString(" GG "); break;
}
return QwtScaleDraw::label(v);
}
};
Bookmarks