19 const QwtScaleMap &map,
const QVector<double> &values )
23 for (
int i = 0;
i < values.size();
i++ )
25 const double y = values[
i ];
90 const QVector<QwtSetSample> &samples )
100 const QVector< QVector<double> > &samples )
102 QVector<QwtSetSample>
s;
103 s.reserve( samples.size() );
105 for (
int i = 0;
i < samples.size();
i++ )
164 if ( valueIndex < 0 )
167 QMap<int, QwtColumnSymbol *>::iterator it =
171 if ( symbol != NULL )
181 if ( symbol != it.value() )
185 if ( symbol == NULL )
210 QMap<int, QwtColumnSymbol *>::const_iterator it =
226 QMap<int, QwtColumnSymbol *>::const_iterator it =
262 int sampleIndex,
int valueIndex )
const 264 Q_UNUSED( sampleIndex );
265 Q_UNUSED( valueIndex );
302 const size_t numSamples =
dataSize();
304 if ( numSamples == 0 )
315 if ( rect.height() >= 0 )
317 if ( rect.bottom() < baseLine )
318 rect.setBottom( baseLine );
319 if ( rect.top() > baseLine )
320 rect.setTop( baseLine );
325 double xMin, xMax, yMin, yMax;
328 yMin = yMax = baseLine;
332 for (
size_t i = 0;
i < numSamples;
i++ )
337 xMin = xMax = sample.
value;
341 xMin = qMin( xMin, sample.
value );
342 xMax = qMax( xMax, sample.
value );
345 const double y = baseLine + sample.
added();
347 yMin = qMin( yMin, y );
348 yMax = qMax( yMax, y );
350 rect.setRect( xMin, yMin, xMax - xMin, yMax - yMin );
354 rect.setRect( rect.y(), rect.x(), rect.height(), rect.width() );
374 const QRectF &canvasRect,
int from,
int to )
const 387 const QwtInterval interval( br.left(), br.right() );
391 for (
int i = from;
i <= to;
i++ )
394 canvasRect, interval,
i,
sample(
i ) );
415 const QRectF &canvasRect,
const QwtInterval &boundingInterval,
418 if ( sample.
set.size() <= 0 )
437 canvasRect, index, sampleW, sample );
442 canvasRect, index, sampleW, sample );
461 const QRectF &canvasRect,
int index,
double sampleWidth,
464 Q_UNUSED( canvasRect );
466 const int numBars = sample.
set.size();
472 const double barWidth = sampleWidth / numBars;
477 for (
int i = 0;
i < numBars;
i++ )
479 const double x1 = x0 +
i * barWidth;
480 const double x2 = x1 + barWidth;
494 drawBar( painter, index,
i, barRect );
499 const double barHeight = sampleWidth / numBars;
504 for (
int i = 0;
i < numBars;
i++ )
506 double y1 = y0 +
i * barHeight;
507 double y2 = y1 + barHeight;
521 drawBar( painter, index,
i, barRect );
541 const QRectF &canvasRect,
int index,
544 Q_UNUSED( canvasRect );
546 const int numBars = sample.
set.size();
567 const int numBars = sample.
set.size();
568 for (
int i = 0;
i < numBars;
i++ )
570 const double si = sample.
set[
i ];
575 const double y2 = yMap.
transform( sum + si );
577 if ( ( y2 > y1 ) != increasing )
610 for (
int i = 0;
i < sample.
set.size();
i++ )
612 const double si = sample.
set[
i ];
617 const double x2 = xMap.
transform( sum + si );
619 if ( ( x2 > x1 ) != increasing )
652 int sampleIndex,
int valueIndex,
const QwtColumnRect &rect )
const 655 if ( sampleIndex >= 0 )
660 sym =
symbol( valueIndex );
664 sym->
draw( painter, rect );
672 sym.
draw( painter, rect );
688 QList<QwtLegendData> list;
689 #if QT_VERSION >= 0x040700 704 qVariantSetValue( iconValue,
726 const QSizeF &size )
const 736 QPainter painter( &icon );
737 painter.setRenderHint( QPainter::Antialiasing,
740 drawBar( &painter, -1, index, column );
virtual void legendChanged()
QMap< int, QwtColumnSymbol * > symbolMap
virtual size_t dataSize() const
Qt::Orientation orientation() const
QwtInterval vInterval
Interval for the vertical coordinates.
QwtInterval normalized() const
Normalize the limits of the interval.
Interface for iterating over an array of samples.
virtual QRectF boundingRect() const =0
A class representing an interval.
Max value is not included in the interval.
A drawing primitive for columns.
For QwtPlotMultiBarChart.
virtual QList< QwtLegendData > legendData() const
void setData(QwtSeriesData< QwtSetSample > *series)
QwtPlotMultiBarChart displays a series of a samples that consist each of a set of values...
Direction direction
Direction.
static bool qwtIsIncreasing(const QwtScaleMap &map, const QVector< double > &values)
QList< QwtText > barTitles
virtual void drawBar(QPainter *, int sampleIndex, int barIndex, const QwtColumnRect &) const
Abstract base class for bar chart items.
QwtSeriesData< QwtSetSample > * data()
TFSIMD_FORCE_INLINE const tfScalar & y() const
void setStyle(ChartStyle style)
void setBarTitles(const QList< QwtText > &)
Set the titles for the bars.
void setSamples(const QVector< QwtSetSample > &)
virtual QwtGraphic legendIcon(int index, const QSizeF &) const
QSize legendIconSize() const
A sample of the types (x1...xn, y) or (x, y1..yn)
void setDefaultSize(const QSizeF &)
Set a default size.
virtual void drawSeries(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const
QList< QwtText > barTitles() const
bool testRenderHint(RenderHint) const
QwtPlotMultiBarChart::ChartStyle style
virtual void drawSample(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, const QwtInterval &boundingInterval, int index, const QwtSetSample &sample) const
virtual QwtColumnSymbol * specialSymbol(int sampleIndex, int valueIndex) const
Create a symbol for special values.
void setFrameStyle(FrameStyle style)
A class representing a text.
virtual QRectF boundingRect() const
Min value is not included in the interval.
const QwtColumnSymbol * symbol(int barIndex) const
A paint device for scalable graphics.
virtual QRectF boundingRect() const
void setBorderFlags(BorderFlags)
void setLineWidth(int width)
QwtSetSample sample(int index) const
virtual void itemChanged()
virtual ~QwtPlotMultiBarChart()
Destructor.
QwtPlotMultiBarChart(const QString &title=QString())
void drawGroupedBars(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int index, double sampleWidth, const QwtSetSample &sample) const
Directed rectangle representing bounding rectangle and orientation of a column.
void setValue(int role, const QVariant &)
double sampleWidth(const QwtScaleMap &map, double canvasSize, double dataSize, double value) const
virtual void draw(QPainter *, const QwtColumnRect &) const
QwtInterval hInterval
Interval for the horizontal coordinates.
void setSymbol(int barIndex, QwtColumnSymbol *symbol)
Add a symbol to the symbol map.
virtual T sample(size_t i) const =0
The bars of a set are displayed side by side.
void drawStackedBars(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int index, double sampleWidth, const QwtSetSample &sample) const
double transform(double s) const
double width() const
Return the width of an interval.
Min/Max values are inside the interval.
QVector< double > set
Vector of values associated to value.
Attributes of an entry on a legend.
const QwtText & title() const