Qwt User's Guide
|
00001 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** 00002 * Qwt Widget Library 00003 * Copyright (C) 1997 Josef Wilgen 00004 * Copyright (C) 2002 Uwe Rathmann 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the Qwt License, Version 1.0 00008 *****************************************************************************/ 00009 00010 #ifndef QWT_PLOT_BAR_CHART_H 00011 #define QWT_PLOT_BAR_CHART_H 00012 00013 #include "qwt_global.h" 00014 #include "qwt_plot_abstract_barchart.h" 00015 #include "qwt_series_data.h" 00016 00017 class QwtColumnRect; 00018 class QwtColumnSymbol; 00019 00041 class QWT_EXPORT QwtPlotBarChart: 00042 public QwtPlotAbstractBarChart, public QwtSeriesStore<QPointF> 00043 { 00044 public: 00051 enum LegendMode 00052 { 00059 LegendChartTitle, 00060 00067 LegendBarTitles 00068 }; 00069 00070 explicit QwtPlotBarChart( const QString &title = QString::null ); 00071 explicit QwtPlotBarChart( const QwtText &title ); 00072 00073 virtual ~QwtPlotBarChart(); 00074 00075 virtual int rtti() const; 00076 00077 void setSamples( const QVector<QPointF> & ); 00078 void setSamples( const QVector<double> & ); 00079 void setSamples( QwtSeriesData<QPointF> *series ); 00080 00081 void setSymbol( QwtColumnSymbol * ); 00082 const QwtColumnSymbol *symbol() const; 00083 00084 void setLegendMode( LegendMode ); 00085 LegendMode legendMode() const; 00086 00087 virtual void drawSeries( QPainter *painter, 00088 const QwtScaleMap &xMap, const QwtScaleMap &yMap, 00089 const QRectF &canvasRect, int from, int to ) const; 00090 00091 virtual QRectF boundingRect() const; 00092 00093 virtual QwtColumnSymbol *specialSymbol( 00094 int sampleIndex, const QPointF& ) const; 00095 00096 virtual QwtText barTitle( int sampleIndex ) const; 00097 00098 protected: 00099 virtual void drawSample( QPainter *painter, 00100 const QwtScaleMap &xMap, const QwtScaleMap &yMap, 00101 const QRectF &canvasRect, const QwtInterval &boundingInterval, 00102 int index, const QPointF& sample ) const; 00103 00104 virtual void drawBar( QPainter *, 00105 int sampleIndex, const QPointF& point, 00106 const QwtColumnRect & ) const; 00107 00108 QList<QwtLegendData> legendData() const; 00109 QwtGraphic legendIcon( int index, const QSizeF & ) const; 00110 00111 private: 00112 void init(); 00113 00114 class PrivateData; 00115 PrivateData *d_data; 00116 }; 00117 00118 #endif