qwt_plot_multi_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_MULTI_BAR_CHART_H
#define QWT_PLOT_MULTI_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 QwtPlotMultiBarChart:
public QwtPlotAbstractBarChart, public QwtSeriesStore<QwtSetSample>
{
public:
enum ChartStyle
{
Grouped,
Stacked
};
explicit QwtPlotMultiBarChart( const QString &title = QString() );
explicit QwtPlotMultiBarChart( const QwtText &title );
virtual ~QwtPlotMultiBarChart();
virtual int rtti() const;
void setBarTitles( const QList<QwtText> & );
QList<QwtText> barTitles() const;
void setSamples( const QVector<QwtSetSample> & );
void setSamples( const QVector< QVector<double> > & );
void setSamples( QwtSeriesData<QwtSetSample> * );
void setStyle( ChartStyle style );
ChartStyle style() const;
void setSymbol( int valueIndex, QwtColumnSymbol * );
const QwtColumnSymbol *symbol( int valueIndex ) const;
void resetSymbolMap();
virtual void drawSeries( QPainter *painter,
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRectF &canvasRect, int from, int to ) const;
virtual QRectF boundingRect() const;
virtual QList<QwtLegendData> legendData() const;
virtual QwtGraphic legendIcon( int index, const QSizeF & ) const;
protected:
QwtColumnSymbol *symbol( int valueIndex );
virtual QwtColumnSymbol *specialSymbol(
int sampleIndex, int valueIndex ) const;
virtual void drawSample( QPainter *painter,
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRectF &canvasRect, const QwtInterval &boundingInterval,
int index, const QwtSetSample& sample ) const;
virtual void drawBar( QPainter *, int sampleIndex,
int valueIndex, const QwtColumnRect & ) const;
void drawStackedBars( QPainter *painter,
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRectF &canvasRect, int index,
double sampleWidth, const QwtSetSample& sample ) const;
void drawGroupedBars( QPainter *painter,
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRectF &canvasRect, int index,
double sampleWidth, const QwtSetSample& sample ) const;
private:
void init();
class PrivateData;
PrivateData *d_data;
};
#endif
QwtPlotMultiBarChart::ChartStyle
ChartStyle
Chart styles.
Definition: qwt_plot_multi_barchart.h:51
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
QwtColumnRect
Directed rectangle representing bounding rectangle and orientation of a column.
Definition: qwt_column_symbol.h:28
QwtSeriesData< QwtSetSample >
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
QwtSetSample
A sample of the types (x1...xn, y) or (x, y1..yn)
Definition: qwt_samples.h:76
QwtGraphic
A paint device for scalable graphics.
Definition: qwt_graphic.h:74
QwtPlotMultiBarChart
QwtPlotMultiBarChart displays a series of a samples that consist each of a set of values...
Definition: qwt_plot_multi_barchart.h:41
QwtInterval
A class representing an interval.
Definition: qwt_interval.h:26
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
QwtPlotMultiBarChart::Grouped
The bars of a set are displayed side by side.
Definition: qwt_plot_multi_barchart.h:54
QwtPlotSeriesItem::drawSeries
virtual void drawSeries(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const =0