101 points.reserve( samples.size() );
103 for (
int i = 0; i < samples.size(); i++ )
104 points += QPointF( i, samples[ i ] );
188 const size_t numSamples =
dataSize();
189 if ( numSamples == 0 )
193 if ( rect.height() >= 0 )
197 if ( rect.bottom() < baseLine )
198 rect.setBottom( baseLine );
200 if ( rect.top() > baseLine )
201 rect.setTop( baseLine );
205 rect.setRect( rect.y(), rect.x(), rect.height(), rect.width() );
225 const QRectF &canvasRect,
int from,
int to )
const 238 const QwtInterval interval( br.left(), br.right() );
242 for (
int i = from; i <= to; i++ )
245 canvasRect, interval, i,
sample( i ) );
264 const QRectF &canvasRect,
const QwtInterval &boundingInterval,
265 const QPointF &
sample )
const 271 const double barHeight =
sampleWidth( yMap, canvasRect.height(),
272 boundingInterval.
width(), sample.y() );
275 const double x2 = xMap.
transform( sample.y() );
277 const double y = yMap.
transform( sample.x() );
278 const double y1 = y - 0.5 * barHeight;
279 const double y2 = y + 0.5 * barHeight;
289 const double barWidth =
sampleWidth( xMap, canvasRect.width(),
290 boundingInterval.
width(), sample.y() );
292 const double x = xMap.
transform( sample.x() );
293 const double x1 = x - 0.5 * barWidth;
294 const double x2 = x + 0.5 * barWidth;
297 const double y2 = yMap.
transform( sample.y() );
324 const QRectF &canvasRect,
const QwtInterval &boundingInterval,
325 int index,
const QPointF &
sample )
const 328 canvasRect, boundingInterval, sample );
330 drawBar( painter, index, sample, barRect );
342 int sampleIndex,
const QPointF &
sample,
354 sym->
draw( painter, rect );
362 columnSymbol.
draw( painter, rect );
378 int sampleIndex,
const QPointF &
sample )
const 380 Q_UNUSED( sampleIndex );
401 Q_UNUSED( sampleIndex );
422 const size_t numSamples =
dataSize();
423 list.reserve( numSamples );
425 for (
size_t i = 0; i < numSamples; i++ )
430 QVariant::fromValue(
barTitle( i ) ) );
463 int index,
const QSizeF &size )
const 473 QPainter painter( &icon );
474 painter.setRenderHint( QPainter::Antialiasing,
481 drawBar( &painter, barIndex, QPointF(), column );
virtual void legendChanged()
const QwtColumnSymbol * symbol() const
Qt::Orientation orientation() const
virtual QList< QwtLegendData > legendData() const
Return all information, that is needed to represent the item on the legend.
QwtInterval vInterval
Interval for the vertical coordinates.
QwtInterval normalized() const
Normalize the limits of the interval.
virtual ~QwtPlotBarChart()
Destructor.
void setSamples(const QVector< QPointF > &)
virtual QRectF boundingRect() const =0
A class representing an interval.
A drawing primitive for columns.
virtual void drawSeries(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const QWT_OVERRIDE
QwtGraphic legendIcon(int index, const QSizeF &) const QWT_OVERRIDE
void setData(QwtSeriesData< QPointF > *series)
void setLegendMode(LegendMode)
Direction direction
Direction.
virtual int rtti() const QWT_OVERRIDE
Abstract base class for bar chart items.
QwtSeriesData< QPointF > * data()
QSize legendIconSize() const
void setDefaultSize(const QSizeF &)
Set a default size.
QwtPlotBarChart displays a series of a values as bars.
void setSymbol(QwtColumnSymbol *)
Assign a symbol.
virtual QwtColumnSymbol * specialSymbol(int sampleIndex, const QPointF &) const
virtual QRectF boundingRect() const QWT_OVERRIDE
bool testRenderHint(RenderHint) const
double sampleWidth(const QwtScaleMap &map, double canvasSize, double boundingSize, double value) const
A class representing a text.
virtual QwtText barTitle(int sampleIndex) const
Return the title of a bar.
void setFrameStyle(FrameStyle)
A paint device for scalable graphics.
virtual void drawBar(QPainter *, int sampleIndex, const QPointF &sample, const QwtColumnRect &) const
void setLineWidth(int width)
QPointF sample(int index) const
virtual void itemChanged()
QwtColumnRect columnRect(const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, const QwtInterval &boundingInterval, const QPointF &sample) const
QwtPlotBarChart::LegendMode legendMode
Directed rectangle representing bounding rectangle and orientation of a column.
void setValue(int role, const QVariant &)
QList< QwtLegendData > legendData() const QWT_OVERRIDE
Return all information, that is needed to represent the item on the legend.
virtual void draw(QPainter *, const QwtColumnRect &) const
LegendMode legendMode() const
QwtInterval hInterval
Interval for the horizontal coordinates.
virtual size_t dataSize() const QWT_OVERRIDE
double transform(double s) const
virtual void drawSample(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, const QwtInterval &boundingInterval, int index, const QPointF &sample) const
double width() const
Return the width of an interval.
Interface for iterating over an array of points.
Attributes of an entry on a legend.
virtual QRectF boundingRect() const QWT_OVERRIDE
QwtPlotBarChart(const QString &title=QString())
const QwtText & title() const