Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
6.2.0 Beta3
-
None
Description
I'm using an approach similar to TradingView's Lightweight Charts for drawing nice numbers for time values. It has one so-called logical axis, a float axis whose round values correspond to the indices of a data set and indicate current zoom and pan levels. I compute a tick interval and a tick anchor and attach category labels (with time values) where I need to draw them. And I can skip weekends and non-trading hours as well as opposed to QDateTimeAxis. I've attached the screenshot, how it looks.
All is needed from you is to add one line
case QAbstractAxis::AxisTypeCategory:
Currently I'm using an ugly hack, I've created a QCategoryAxis subclass and overridden the type() method, where I just determine with __builtin_return_address(0) and dladdr the calling function and if it is the Candlestick::updateGeometry I return AxisTypeValue, otherwise the behaviour is default. Technically it works but it depends on the private code changes.