17 const double w2 = 0.5 * width;
19 const double v1 = map.
transform( value - w2 );
20 const double v2 = map.
transform( value + w2 );
22 return qAbs( v2 - v1 );
134 spacing = qMax( spacing, 0 );
162 margin = qMax( margin, 0 );
226 double canvasSize,
double boundingSize,
double value )
const 250 const size_t numSamples =
dataSize();
253 if ( numSamples > 1 )
255 w = qAbs( boundingSize / ( numSamples - 1 ) );
291 double&
left,
double&
top,
double&
right,
double& bottom )
const 315 const size_t numSamples =
dataSize();
316 if ( numSamples <= 0 )
323 double sampleWidthS = 1.0;
333 if ( numSamples > 1 )
335 sampleWidthS = qAbs( br.width() / ( numSamples - 1 ) );
342 ds = qAbs( xMap.
sDist() );
343 w = canvasRect.width();
347 ds = qAbs( yMap.
sDist() );
348 w = canvasRect.height();
351 const double sampleWidthP = ( w - spacing * ( numSamples - 1 ) )
352 * sampleWidthS / ( ds + sampleWidthS );
354 hint = 0.5 * sampleWidthP;
double sampleWidth(const QwtScaleMap &map, double canvasSize, double boundingSize, double value) const
QwtPlotAbstractBarChart(const QwtText &title)
static double qwtTransformWidth(const QwtScaleMap &map, double value, double width)
const QwtText & title() const
double layoutHint() const
QWT_CONSTEXPR float qwtMaxF(float a, float b)
virtual ~QwtPlotAbstractBarChart()
Destructor.
void setLayoutPolicy(LayoutPolicy)
Qt::Orientation orientation() const
Abstract base class for bar chart items.
double transform(double s) const
QwtPlotAbstractBarChart::LayoutPolicy layoutPolicy
void setMargin(int)
Set the margin.
void setSpacing(int)
Set the spacing.
LayoutPolicy
Mode how to calculate the bar width.
The item is represented on the legend.
void setLayoutHint(double)
A class representing a text.
void setZ(double z)
Set the z value.
virtual void getCanvasMarginHint(const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, double &left, double &top, double &right, double &bottom) const QWT_OVERRIDE
Calculate a hint for the canvas margin.
virtual void itemChanged()
virtual size_t dataSize() const =0
void setBaseline(double)
Set the baseline.
Base class for plot items representing a series of samples.
void setItemAttribute(ItemAttribute, bool on=true)
LayoutPolicy layoutPolicy() const
virtual QRectF dataRect() const =0