80 const QVector<QPointF> &samples )
95 const QVector<double> &samples )
97 QVector<QPointF> points;
98 points.reserve( samples.size() );
100 for (
int i = 0;
i < samples.size();
i++ )
101 points += QPointF(
i, samples[
i ] );
185 const size_t numSamples =
dataSize();
186 if ( numSamples == 0 )
190 if ( rect.height() >= 0 )
194 if ( rect.bottom() < baseLine )
195 rect.setBottom( baseLine );
197 if ( rect.top() > baseLine )
198 rect.setTop( baseLine );
202 rect.setRect( rect.y(), rect.x(), rect.height(), rect.width() );
222 const QRectF &canvasRect,
int from,
int to )
const 235 const QwtInterval interval( br.left(), br.right() );
239 for (
int i = from;
i <= to;
i++ )
242 canvasRect, interval,
i,
sample(
i ) );
261 const QRectF &canvasRect,
const QwtInterval &boundingInterval,
262 const QPointF &
sample )
const 268 const double barHeight =
sampleWidth( yMap, canvasRect.height(),
269 boundingInterval.
width(), sample.y() );
272 const double x2 = xMap.
transform( sample.y() );
274 const double y = yMap.
transform( sample.x() );
275 const double y1 = y - 0.5 * barHeight;
276 const double y2 = y + 0.5 * barHeight;
286 const double barWidth =
sampleWidth( xMap, canvasRect.width(),
287 boundingInterval.
width(), sample.y() );
289 const double x = xMap.
transform( sample.x() );
290 const double x1 = x - 0.5 * barWidth;
291 const double x2 = x + 0.5 * barWidth;
294 const double y2 = yMap.
transform( sample.y() );
321 const QRectF &canvasRect,
const QwtInterval &boundingInterval,
322 int index,
const QPointF &
sample )
const 325 canvasRect, boundingInterval, sample );
327 drawBar( painter, index, sample, barRect );
339 int sampleIndex,
const QPointF &
sample,
351 sym->
draw( painter, rect );
359 sym.
draw( painter, rect );
375 int sampleIndex,
const QPointF &
sample )
const 377 Q_UNUSED( sampleIndex );
398 Q_UNUSED( sampleIndex );
415 QList<QwtLegendData> list;
419 const size_t numSamples =
dataSize();
420 #if QT_VERSION >= 0x040700 421 list.reserve( numSamples );
424 for (
size_t i = 0;
i < numSamples;
i++ )
429 qVariantSetValue( titleValue,
barTitle(
i ) );
435 qVariantSetValue( iconValue,
466 int index,
const QSizeF &size )
const 476 QPainter painter( &icon );
477 painter.setRenderHint( QPainter::Antialiasing,
484 drawBar( &painter, barIndex, QPointF(), column );
virtual void legendChanged()
const QwtColumnSymbol * symbol() const
virtual size_t dataSize() 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 > &)
QwtGraphic legendIcon(int index, const QSizeF &) const
virtual QRectF boundingRect() const =0
A class representing an interval.
A drawing primitive for columns.
virtual void drawSeries(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const
void setData(QwtSeriesData< QPointF > *series)
void setLegendMode(LegendMode)
Direction direction
Direction.
Abstract base class for bar chart items.
QwtSeriesData< QPointF > * data()
TFSIMD_FORCE_INLINE const tfScalar & y() const
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
QList< QwtLegendData > legendData() const
Return all information, that is needed to represent the item on the legend.
bool testRenderHint(RenderHint) const
void setFrameStyle(FrameStyle style)
A class representing a text.
virtual QwtText barTitle(int sampleIndex) const
Return the title of a bar.
A paint device for scalable graphics.
TFSIMD_FORCE_INLINE const tfScalar & x() const
virtual QRectF boundingRect() 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
virtual void drawBar(QPainter *, int sampleIndex, const QPointF &point, const QwtColumnRect &) const
QwtPlotBarChart::LegendMode legendMode
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
LegendMode legendMode() const
QwtInterval hInterval
Interval for the horizontal coordinates.
virtual QRectF boundingRect() const
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.
QwtPlotBarChart(const QString &title=QString())
const QwtText & title() const