QWT 7.0.1
Loading...
Searching...
No Matches
qwt_plot_abstract_barchart.h
1/******************************************************************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *
9 * Modified by ChenZongYan in 2024 <czy.t@163.com>
10 * Summary of major modifications (see ChangeLog.md for full history):
11 * 1. CMake build system & C++11 throughout.
12 * 2. Core panner/ zoomer refactored:
13 * - QwtPanner → QwtCachePanner (pixmap-cache version)
14 * - New real-time QwtPlotPanner derived from QwtPicker.
15 * 3. Zoomer supports multi-axis.
16 * 4. Parasite-plot framework:
17 * - QwtFigure, QwtPlotParasiteLayout, QwtPlotTransparentCanvas,
18 * - QwtPlotScaleEventDispatcher, built-in pan/zoom on axis.
19 * 5. New picker: QwtPlotSeriesDataPicker (works with date axis).
20 * 6. Raster & color-map extensions:
21 * - QwtGridRasterData (2-D table + interpolation)
22 * - QwtLinearColorMap::stopColors(), stopPos() API rename.
23 * 7. Bar-chart: expose pen/brush control.
24 * 8. Amalgamated build: single QwtPlot.h / QwtPlot.cpp pair in src-amalgamate.
25 *****************************************************************************/
26
27#ifndef QWT_PLOT_ABSTRACT_BAR_CHART_H
28#define QWT_PLOT_ABSTRACT_BAR_CHART_H
29
30#include "qwt_global.h"
31#include "qwt_plot_seriesitem.h"
32
42{
43 public:
78
79 explicit QwtPlotAbstractBarChart( const QwtText& title );
81
82 void setLayoutPolicy( LayoutPolicy );
83 LayoutPolicy layoutPolicy() const;
84
85 void setLayoutHint( double );
86 double layoutHint() const;
87
88 void setSpacing( int );
89 int spacing() const;
90
91 void setMargin( int );
92 int margin() const;
93
94 void setBaseline( double );
95 double baseline() const;
96
97 virtual void getCanvasMarginHint(
98 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
99 const QRectF& canvasRect, double& left, double& top,
100 double& right, double& bottom) const QWT_OVERRIDE;
101
102
103 protected:
104 double sampleWidth( const QwtScaleMap& map,
105 double canvasSize, double boundingSize,
106 double value ) const;
107
108 private:
109 class PrivateData;
110 PrivateData* m_data;
111};
112
113#endif
Abstract base class for bar chart items.
Definition qwt_plot_abstract_barchart.h:42
LayoutPolicy
Mode how to calculate the bar width.
Definition qwt_plot_abstract_barchart.h:50
@ AutoAdjustSamples
The sample width is calculated by dividing the bounding rectangle by the number of samples.
Definition qwt_plot_abstract_barchart.h:58
@ ScaleSamplesToAxes
layoutHint() defines an interval in axis coordinates
Definition qwt_plot_abstract_barchart.h:63
@ ScaleSampleToCanvas
The bar width is calculated by multiplying layoutHint() with the height or width of the canvas.
Definition qwt_plot_abstract_barchart.h:71
virtual void getCanvasMarginHint(const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, double &left, double &top, double &right, double &bottom) const
Calculate a hint for the canvas margin.
Definition qwt_plot_item.cpp:612
Base class for plot items representing a series of samples.
Definition qwt_plot_seriesitem.h:43
A scale map.
Definition qwt_scale_map.h:44
A class representing a text.
Definition qwt_text.h:69