qwt_plot_barchart.h
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#ifndef QWT_PLOT_BAR_CHART_H
#define QWT_PLOT_BAR_CHART_H
#include "qwt_global.h"
#include "qwt_plot_abstract_barchart.h"
#include "qwt_series_data.h"
class QwtColumnRect;
class QwtColumnSymbol;
class QWT_EXPORT QwtPlotBarChart:
public QwtPlotAbstractBarChart, public QwtSeriesStore<QPointF>
{
public:
enum LegendMode
{
LegendChartTitle,
LegendBarTitles
};
explicit QwtPlotBarChart( const QString &title = QString() );
explicit QwtPlotBarChart( const QwtText &title );
virtual ~QwtPlotBarChart();
virtual int rtti() const;
void setSamples( const QVector<QPointF> & );
void setSamples( const QVector<double> & );
void setSamples( QwtSeriesData<QPointF> * );
void setSymbol( QwtColumnSymbol * );
const QwtColumnSymbol *symbol() const;
void setLegendMode( LegendMode );
LegendMode legendMode() const;
virtual void drawSeries( QPainter *painter,
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRectF &canvasRect, int from, int to ) const;
virtual QRectF boundingRect() const;
virtual QwtColumnSymbol *specialSymbol(
int sampleIndex, const QPointF& ) const;
virtual QwtText barTitle( int sampleIndex ) const;
protected:
virtual void drawSample( QPainter *painter,
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRectF &canvasRect, const QwtInterval &boundingInterval,
int index, const QPointF& sample ) const;
virtual void drawBar( QPainter *,
int sampleIndex, const QPointF& sample,
const QwtColumnRect & ) const;
QList<QwtLegendData> legendData() const;
QwtGraphic legendIcon( int index, const QSizeF & ) const;
private:
void init();
class PrivateData;
PrivateData *d_data;
};
#endif
QwtPlotBarChart
QwtPlotBarChart displays a series of a values as bars.
Definition: qwt_plot_barchart.h:41
QwtText
A class representing a text.
Definition: qwt_text.h:51
QwtPlotItem::legendData
virtual QList< QwtLegendData > legendData() const
Return all information, that is needed to represent the item on the legend.
Definition: qwt_plot_item.cpp:595
QwtScaleMap
A scale map.
Definition: qwt_scale_map.h:30
QwtPlotBarChart::LegendChartTitle
Definition: qwt_plot_barchart.h:59
QwtColumnRect
Directed rectangle representing bounding rectangle and orientation of a column.
Definition: qwt_column_symbol.h:28
QwtSeriesData< QPointF >
QwtColumnSymbol
A drawing primitive for columns.
Definition: qwt_column_symbol.h:93
QwtSeriesStore
Class storing a QwtSeriesData object.
Definition: qwt_series_store.h:65
QwtPlotItem::legendIcon
virtual QwtGraphic legendIcon(int index, const QSizeF &) const
Definition: qwt_plot_item.cpp:371
QwtGraphic
A paint device for scalable graphics.
Definition: qwt_graphic.h:74
QwtInterval
A class representing an interval.
Definition: qwt_interval.h:26
QwtPlotBarChart::LegendMode
LegendMode
Legend modes.
Definition: qwt_plot_barchart.h:51
QwtPlotSeriesItem::boundingRect
virtual QRectF boundingRect() const
Definition: qwt_plot_seriesitem.cpp:95
QwtPlotItem::rtti
virtual int rtti() const
Definition: qwt_plot_item.cpp:120
QwtPlotAbstractBarChart
Abstract base class for bar chart items.
Definition: qwt_plot_abstract_barchart.h:25
QwtPlotSeriesItem::drawSeries
virtual void drawSeries(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const =0