QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
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
41{
42public:
77
78 // Constructor with title
79 explicit QwtPlotAbstractBarChart(const QwtText& title);
80 // Destructor
81 ~QwtPlotAbstractBarChart() override;
82
83 // Set the layout policy for bar width calculation
84 void setLayoutPolicy(LayoutPolicy);
85 // Get the layout policy
86 LayoutPolicy layoutPolicy() const;
87
88 // Set the layout hint for bar width calculation
89 void setLayoutHint(double);
90 // Get the layout hint
91 double layoutHint() const;
92
93 // Set the spacing between bars
94 void setSpacing(int);
95 // Get the spacing between bars
96 int spacing() const;
97
98 // Set the margin around the bars
99 void setMargin(int);
100 // Get the margin around the bars
101 int margin() const;
102
103 // Set the baseline value for the bars
104 void setBaseline(double);
105 // Get the baseline value
106 double baseline() const;
107
108 // Calculate canvas margin hint for layout
109 virtual void getCanvasMarginHint(const QwtScaleMap& xMap,
110 const QwtScaleMap& yMap,
111 const QRectF& canvasRect,
112 double& left,
113 double& top,
114 double& right,
115 double& bottom) const override;
116
117protected:
118 double sampleWidth(const QwtScaleMap& map, double canvasSize, double boundingSize, double value) const;
119
120private:
121 QWT_DECLARE_PRIVATE(QwtPlotAbstractBarChart)
122};
123
124#endif
Abstract base class for bar chart items
Definition qwt_plot_abstract_barchart.h:41
LayoutPolicy
Mode how to calculate the bar width
Definition qwt_plot_abstract_barchart.h:49
@ AutoAdjustSamples
The sample width is calculated by dividing the bounding rectangle by the number of samples.
Definition qwt_plot_abstract_barchart.h:57
@ ScaleSamplesToAxes
layoutHint() defines an interval in axis coordinates
Definition qwt_plot_abstract_barchart.h:62
@ ScaleSampleToCanvas
The bar width is calculated by multiplying layoutHint() with the height or width of the canvas.
Definition qwt_plot_abstract_barchart.h:70
virtual void getCanvasMarginHint(const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, double &left, double &top, double &right, double &bottom) const
Get margin hints for the canvas
Definition qwt_plot_item.cpp:614
Base class for plot items representing a series of samples
Definition qwt_plot_seriesitem.h:44
A scale map
Definition qwt_scale_map.h:44
A class representing a text
Definition qwt_text.h:70