|
QTradingView 1.0.0
A high-performance charting library built with C++ and Qt.
|
Linear scale implementation for chart axes. More...
#include <LinearScale.h>
Public Member Functions | |
| LinearScale () | |
| Constructs a LinearScale with default domain and range. | |
| LinearScale (double minValue, double maxValue, double minPixel, double maxPixel) | |
| Constructs a LinearScale with specified domain and range. | |
| ~LinearScale () override=default | |
| Destructor. | |
| double | dataToPixel (double value) const override |
| Converts a data value to a pixel position. | |
| double | pixelToData (double pixel) const override |
| Converts a pixel position to a data value. | |
| void | setDomain (double minValue, double maxValue) override |
| Sets the data domain for the scale. | |
| void | setRange (double minPixel, double maxPixel) override |
| Sets the pixel range for the scale. | |
| std::vector< double > | getTicks (int approxCount) const override |
| Returns tick positions for the scale. | |
| void | applyPadding (double &minValue, double &maxValue, double paddingRatio) const override |
| Applies padding to the data domain. | |
| void | zoomDomain (double &minValue, double &maxValue, double zoomFactor, double anchorValue) const override |
| Zooms the data domain by a factor around an anchor value. | |
Public Member Functions inherited from QTradingView::IScale | |
| virtual | ~IScale ()=default |
| Virtual destructor for IScale. | |
| std::vector< double > | getTicks () const |
| Returns a default vector of tick values (approx. 5). | |
Linear scale implementation for chart axes.
Provides conversion between data values and pixel positions using a linear scale.
| QTradingView::LinearScale::LinearScale | ( | double | minValue, |
| double | maxValue, | ||
| double | minPixel, | ||
| double | maxPixel | ||
| ) |
Constructs a LinearScale with specified domain and range.
| minValue | Minimum data value. |
| maxValue | Maximum data value. |
| minPixel | Minimum pixel position. |
| maxPixel | Maximum pixel position. |
|
overridevirtual |
Applies padding to the data domain.
| minValue | Reference to minimum value to pad. |
| maxValue | Reference to maximum value to pad. |
| paddingRatio | Ratio of padding to apply. |
Implements QTradingView::IScale.
|
overridevirtual |
Converts a data value to a pixel position.
| value | The data value to convert. |
Implements QTradingView::IScale.
|
overridevirtual |
Returns tick positions for the scale.
| approxCount | Approximate number of ticks desired. |
Implements QTradingView::IScale.
|
overridevirtual |
Converts a pixel position to a data value.
| pixel | The pixel position to convert. |
Implements QTradingView::IScale.
|
overridevirtual |
Sets the data domain for the scale.
| minValue | Minimum data value. |
| maxValue | Maximum data value. |
Implements QTradingView::IScale.
|
overridevirtual |
Sets the pixel range for the scale.
| minPixel | Minimum pixel position. |
| maxPixel | Maximum pixel position. |
Implements QTradingView::IScale.
|
overridevirtual |
Zooms the data domain by a factor around an anchor value.
| minValue | Reference to minimum value to zoom. |
| maxValue | Reference to maximum value to zoom. |
| zoomFactor | Zoom factor to apply. |
| anchorValue | Value to anchor the zoom. |
Implements QTradingView::IScale.