|
QTradingView 1.0.0
A high-performance charting library built with C++ and Qt.
|
Abstract base class for value-to-pixel scaling in QTradingView. More...
#include <IScale.h>
Public Member Functions | |
| virtual | ~IScale ()=default |
| Virtual destructor for IScale. | |
| virtual double | dataToPixel (double value) const =0 |
| Converts a data value to its corresponding pixel position. | |
| virtual double | pixelToData (double pixel) const =0 |
| Converts a pixel position to its corresponding data value. | |
| virtual void | setDomain (double minValue, double maxValue)=0 |
| Sets the domain (min and max data values) for the scale. | |
| virtual void | setRange (double minPixel, double maxPixel)=0 |
| Sets the pixel range for the scale. | |
| virtual std::vector< double > | getTicks (int approxCount) const =0 |
| Returns a vector of tick values for the axis. | |
| std::vector< double > | getTicks () const |
| Returns a default vector of tick values (approx. 5). | |
| virtual void | applyPadding (double &minValue, double &maxValue, double paddingRatio) const =0 |
| Applies padding to the scale domain. | |
| virtual void | zoomDomain (double &minValue, double &maxValue, double zoomFactor, double anchorValue) const =0 |
| Zooms the scale domain around an anchor value. | |
Abstract base class for value-to-pixel scaling in QTradingView.
IScale provides an interface for converting between data values and pixel coordinates, managing scale domains and ranges, and generating axis ticks.
|
pure virtual |
Applies padding to the scale domain.
| minValue | Minimum data value (modified). |
| maxValue | Maximum data value (modified). |
| paddingRatio | Ratio of padding to apply. |
Implemented in QTradingView::LinearScale, and QTradingView::LogScale.
|
pure virtual |
Converts a data value to its corresponding pixel position.
| value | Data value. |
Implemented in QTradingView::LinearScale, and QTradingView::LogScale.
|
inline |
Returns a default vector of tick values (approx. 5).
|
pure virtual |
Returns a vector of tick values for the axis.
| approxCount | Approximate number of ticks desired. |
Implemented in QTradingView::LinearScale, and QTradingView::LogScale.
|
pure virtual |
Converts a pixel position to its corresponding data value.
| pixel | Pixel position. |
Implemented in QTradingView::LinearScale, and QTradingView::LogScale.
|
pure virtual |
Sets the domain (min and max data values) for the scale.
| minValue | Minimum data value. |
| maxValue | Maximum data value. |
Implemented in QTradingView::LinearScale, and QTradingView::LogScale.
|
pure virtual |
Sets the pixel range for the scale.
| minPixel | Minimum pixel value. |
| maxPixel | Maximum pixel value. |
Implemented in QTradingView::LinearScale, and QTradingView::LogScale.
|
pure virtual |
Zooms the scale domain around an anchor value.
| minValue | Minimum data value (modified). |
| maxValue | Maximum data value (modified). |
| zoomFactor | Zoom factor to apply. |
| anchorValue | Value to anchor the zoom operation. |
Implemented in QTradingView::LinearScale, and QTradingView::LogScale.