qwt_plot_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_BAR_CHART_H
#define QWT_PLOT_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 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 QWT_OVERRIDE;
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*,
const QwtScaleMap& xMap, const QwtScaleMap& yMap,
const QRectF& canvasRect, int from, int to ) const QWT_OVERRIDE;
virtual QRectF boundingRect() const QWT_OVERRIDE;
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;
QwtColumnRect columnRect(
const QwtScaleMap& xMap, const QwtScaleMap& yMap,
const QRectF& canvasRect, const QwtInterval& boundingInterval,
const QPointF& sample ) const;
QList< QwtLegendData > legendData() const QWT_OVERRIDE;
QwtGraphic legendIcon( int index, const QSizeF& ) const QWT_OVERRIDE;
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
QwtPlotBarChart
QwtPlotBarChart displays a series of a values as bars.
Definition: qwt_plot_barchart.h:44
QwtPlotBarChart::LegendMode
LegendMode
Legend modes.
Definition: qwt_plot_barchart.h:53
QwtPlotBarChart::LegendChartTitle
@ LegendChartTitle
Definition: qwt_plot_barchart.h:60
QwtPlotItem::rtti
virtual int rtti() const
Definition: qwt_plot_item.cpp:136
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
QwtText
A class representing a text.
Definition: qwt_text.h:52