|
QTradingView 1.0.0
A high-performance charting library built with C++ and Qt.
|
Logarithmic scale implementation for chart axes. More...
#include <LogScale.h>
Public Member Functions | |
| LogScale () | |
| Constructs a LogScale with default domain and range. | |
| LogScale (double minValue, double maxValue, double minPixel, double maxPixel) | |
| Constructs a LogScale with specified domain and range. | |
| ~LogScale () 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. | |
| void | setLinearThreshold (double threshold) |
| Sets the threshold below which the scale behaves linearly. | |
| double | getLinearThreshold () const |
| Gets the current linear threshold 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). | |
Logarithmic scale implementation for chart axes.
Provides conversion between data values and pixel positions using a symmetric logarithmic scale.
| QTradingView::LogScale::LogScale | ( | double | minValue, |
| double | maxValue, | ||
| double | minPixel, | ||
| double | maxPixel | ||
| ) |
Constructs a LogScale 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.
| double QTradingView::LogScale::getLinearThreshold | ( | ) | const |
Gets the current linear threshold value.
|
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.
| void QTradingView::LogScale::setLinearThreshold | ( | double | threshold | ) |
Sets the threshold below which the scale behaves linearly.
| threshold | The linear threshold value. |
|
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.