Loading...
Searching...
No Matches
qwt_plot_multi_barchart.h
/******************************************************************************
* 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"
class QwtColumnRect;
class QwtColumnSymbol;
template< typename T > class QwtSeriesData;
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 QWT_OVERRIDE;
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*,
const QwtScaleMap& xMap, const QwtScaleMap& yMap,
const QRectF& canvasRect, int from, int to ) const QWT_OVERRIDE;
virtual QRectF boundingRect() const QWT_OVERRIDE;
virtual QList< QwtLegendData > legendData() const QWT_OVERRIDE;
virtual QwtGraphic legendIcon(
int index, const QSizeF& ) const QWT_OVERRIDE;
protected:
QwtColumnSymbol* symbol( int valueIndex );
virtual QwtColumnSymbol* specialSymbol(
int sampleIndex, int valueIndex ) const;
virtual void drawSample( QPainter*,
const QwtScaleMap& xMap, const QwtScaleMap& yMap,
const QRectF& canvasRect, const QwtInterval& boundingInterval,
int index, const QwtSetSample& ) const;
virtual void drawBar( QPainter*, int sampleIndex,
int valueIndex, const QwtColumnRect& ) const;
void drawStackedBars( QPainter*,
const QwtScaleMap& xMap, const QwtScaleMap& yMap,
const QRectF& canvasRect, int index,
double sampleWidth, const QwtSetSample& ) const;
void drawGroupedBars( QPainter*,
const QwtScaleMap& xMap, const QwtScaleMap& yMap,
const QRectF& canvasRect, int index,
double sampleWidth, const QwtSetSample& ) const;
private:
void init();
class PrivateData;
PrivateData* m_data;
};
#endif
QList
Definition qwt_abstract_legend.h:17
QVector
Definition qwt_clipper.h:23
QwtColumnRect
Directed rectangle representing bounding rectangle and orientation of a column.
Definition qwt_column_symbol.h:27
QwtColumnSymbol
A drawing primitive for columns.
Definition qwt_column_symbol.h:75
QwtGraphic
A paint device for scalable graphics.
Definition qwt_graphic.h:76
QwtInterval
A class representing an interval.
Definition qwt_interval.h:23
QwtLegendData
Attributes of an entry on a legend.
Definition qwt_legend_data.h:37
QwtPlotAbstractBarChart
Abstract base class for bar chart items.
Definition qwt_plot_abstract_barchart.h:25
QwtPlotItem::rtti
virtual int rtti() const
Definition qwt_plot_item.cpp:136
QwtPlotMultiBarChart
QwtPlotMultiBarChart displays a series of a samples that consist each of a set of values.
Definition qwt_plot_multi_barchart.h:44
QwtPlotMultiBarChart::ChartStyle
ChartStyle
Chart styles.
Definition qwt_plot_multi_barchart.h:53
QwtPlotMultiBarChart::Grouped
@ Grouped
The bars of a set are displayed side by side.
Definition qwt_plot_multi_barchart.h:55
QwtScaleMap
A scale map.
Definition qwt_scale_map.h:27
QwtSeriesData
Abstract interface for iterating over samples.
Definition qwt_series_data.h:50
QwtSeriesStore
Class storing a QwtSeriesData object.
Definition qwt_series_store.h:67
QwtSetSample
A sample of the types (x1...xn, y) or (x, y1..yn)
Definition qwt_samples.h:74
QwtText
A class representing a text.
Definition qwt_text.h:52