Go to the documentation of this file.
23 bool isInverting =
map.isInverting();
25 for (
int i = 0; i < values.size(); i++ )
27 const double y = values[ i ];
29 return (
map.isInverting() != (
y > 0.0 ) );
105 s.reserve( samples.size() );
107 for (
int i = 0; i < samples.size(); i++ )
166 if ( valueIndex < 0 )
183 if (
symbol != it.value() )
264 int sampleIndex,
int valueIndex )
const
266 Q_UNUSED( sampleIndex );
267 Q_UNUSED( valueIndex );
304 const size_t numSamples =
dataSize();
306 if ( numSamples == 0 )
317 if ( rect.height() >= 0 )
319 if ( rect.bottom() < baseLine )
320 rect.setBottom( baseLine );
321 if ( rect.top() > baseLine )
322 rect.setTop( baseLine );
327 double xMin, xMax, yMin, yMax;
330 yMin = yMax = baseLine;
334 for (
size_t i = 0; i < numSamples; i++ )
352 rect.setRect( xMin, yMin, xMax - xMin, yMax - yMin );
356 rect.setRect( rect.y(), rect.x(), rect.height(), rect.width() );
376 const QRectF& canvasRect,
int from,
int to )
const
389 const QwtInterval interval( br.left(), br.right() );
393 for (
int i = from; i <= to; i++ )
396 canvasRect, interval, i,
sample( i ) );
417 const QRectF& canvasRect,
const QwtInterval& boundingInterval,
439 canvasRect, index, sampleW,
sample );
444 canvasRect, index, sampleW,
sample );
463 const QRectF& canvasRect,
int index,
double sampleWidth,
466 Q_UNUSED( canvasRect );
479 for (
int i = 0; i < numBars; i++ )
481 const double x1 = x0 + i * barWidth;
482 const double x2 = x1 + barWidth;
496 drawBar( painter, index, i, barRect );
506 for (
int i = 0; i < numBars; i++ )
508 double y1 = y0 + i * barHeight;
509 double y2 = y1 + barHeight;
523 drawBar( painter, index, i, barRect );
543 const QRectF& canvasRect,
int index,
546 Q_UNUSED( canvasRect );
569 for (
int i = 0; i < numBars; i++ )
576 const double y2 = yMap.
transform( sum + si );
578 if ( ( y2 > y1 ) != increasing )
587 drawBar( painter, index, i, bar );
611 for (
int i = 0; i <
sample.
set.size(); i++ )
618 const double x2 = xMap.
transform( sum + si );
620 if ( ( x2 > x1 ) != increasing )
629 drawBar( painter, index, i, bar );
653 int sampleIndex,
int valueIndex,
const QwtColumnRect& rect )
const
656 if ( sampleIndex >= 0 )
661 sym =
symbol( valueIndex );
665 sym->
draw( painter, rect );
673 columnSymbol.
draw( painter, rect );
721 const QSizeF&
size )
const
731 QPainter painter( &icon );
732 painter.setRenderHint( QPainter::Antialiasing,
735 drawBar( &painter, -1, index, column );
Attributes of an entry on a legend.
virtual int rtti() const QWT_OVERRIDE
virtual void drawBar(QPainter *, int sampleIndex, int valueIndex, const QwtColumnRect &) const
void setBarTitles(const QList< QwtText > &)
Set the titles for the bars.
QwtInterval vInterval
Interval for the vertical coordinates.
QwtSetSample sample(int index) const
virtual void legendChanged()
A paint device for scalable graphics.
Qt::Orientation orientation() const
virtual QRectF boundingRect() const QWT_OVERRIDE
@ LeftToRight
From left to right.
@ ExcludeMaximum
Max value is not included in the interval.
void setRenderHint(RenderHint, bool on=true)
void drawGroupedBars(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int index, double sampleWidth, const QwtSetSample &) const
QwtArraySeriesData< QwtSetSample > QwtSetSeriesData
Interface for iterating over an array of samples.
void setSamples(const QVector< QwtSetSample > &)
QList< QwtText > barTitles() const
void setData(QwtSeriesData< QwtSetSample > *series)
A drawing primitive for columns.
@ Plain
A plain frame style.
void setSymbol(int valueIndex, QwtColumnSymbol *)
Add a symbol to the symbol map.
virtual QList< QwtLegendData > legendData() const QWT_OVERRIDE
Direction direction
Direction.
QWT_CONSTEXPR float qwtMinF(float a, float b)
QMap< int, QwtColumnSymbol * > symbolMap
static bool qwtIsIncreasing(const QwtScaleMap &map, const QVector< double > &values)
span_constexpr std::size_t size(span< T, Extent > const &spn)
virtual ~QwtPlotMultiBarChart()
Destructor.
virtual void drawSeries(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const QWT_OVERRIDE
void drawStackedBars(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int index, double sampleWidth, const QwtSetSample &) const
A class representing an interval.
void setStyle(ChartStyle style)
A class representing a text.
@ Rtti_PlotMultiBarChart
For QwtPlotMultiBarChart.
double width() const
Return the width of an interval.
@ BottomToTop
From bottom to top.
@ TopToBottom
From top to bottom.
virtual QRectF boundingRect() const
QWT_CONSTEXPR float qwtMaxF(float a, float b)
A sample of the types (x1...xn, y) or (x, y1..yn)
virtual QwtColumnSymbol * specialSymbol(int sampleIndex, int valueIndex) const
Create a symbol for special values.
QwtPlotMultiBarChart::ChartStyle style
void setBorderFlags(BorderFlags)
QwtInterval hInterval
Interval for the horizontal coordinates.
virtual T sample(size_t i) const =0
QList< QwtText > barTitles
@ ExcludeMinimum
Min value is not included in the interval.
QwtSeriesData< QwtSetSample > * data()
double transform(double s) const
virtual void itemChanged()
virtual size_t dataSize() const QWT_OVERRIDE
void setFrameStyle(FrameStyle)
Directed rectangle representing bounding rectangle and orientation of a column.
QwtPlotMultiBarChart(const QString &title=QString())
QVector< double > set
Vector of values associated to value.
@ Grouped
The bars of a set are displayed side by side.
@ IncludeBorders
Min/Max values are inside the interval.
QwtInterval normalized() const
Normalize the limits of the interval.
Abstract base class for bar chart items.
virtual QRectF boundingRect() const QWT_OVERRIDE
@ RightToLeft
From right to left.
double sampleWidth(const QwtScaleMap &map, double canvasSize, double boundingSize, double value) const
bool testRenderHint(RenderHint) const
const QwtColumnSymbol * symbol(int valueIndex) const
@ RenderAntialiased
Enable antialiasing.
QwtPlotMultiBarChart displays a series of a samples that consist each of a set of values.
virtual void draw(QPainter *, const QwtColumnRect &) const
virtual void drawSample(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, const QwtInterval &boundingInterval, int index, const QwtSetSample &) const
void setDefaultSize(const QSizeF &)
Set a default size.
void setLineWidth(int width)
virtual QwtGraphic legendIcon(int index, const QSizeF &) const QWT_OVERRIDE
QSize legendIconSize() const
plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:46