Results 1 to 3 of 3

Thread: Number of tick marks on the axis in QBarCategoryAxis.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2019
    Posts
    12
    Thanks
    5
    Qt products
    Platforms
    Windows

    Default Number of tick marks on the axis in QBarCategoryAxis.

    I managed to put string values on the x axis(datetime data is converted to a string).
    Created on the x axis QBarCategoryAxis.
    Everything would be fine, but I can't adjust tick marks on the axis.

    To avoid being verbose more details here https://forum.qt.io/topic/118786/can...settickcount/2

    If that's not possible, say so.
    Since this idea is long-standing and time-consuming.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,677
    Thanks
    13
    Thanked 1,596 Times in 1,524 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Number of tick marks on the axis in QBarCategoryAxis.

    Looking at the docs for QBarCategoryAxis the intended use of this Axis is for discrete categories on a bar chart, not an abbreviation of a continuous time line. Bar chart categories are typically few in number. This class renders as many tick marks as needed to separate the categories.

    The QDateTimeAxis class is for displaying a continuous time line, which includes the two days of weekend (I assume) that result in gaps because you do not have data on those days.
    You might be able to use QDateTimeAxis considering the answer in this Stack Overflow response: https://stackoverflow.com/questions/...goryaxis-in-qt.
    Ultimately, I think you would end up writing your own QuantWeekdayTimeAxis subclass of QAbstractAxisClass to achieve what you want.

    As a completely different approach look at Qwt, particularly the QwtPlotTradingCurve (also https://qwt.sourceforge.io/otherscreenshots.html). The learning curve here is steeper, but the flexibility is almost certainly there.

  3. The following user says thank you to ChrisW67 for this useful post:

    quant (20th September 2020)

  4. #3
    Join Date
    Aug 2019
    Posts
    12
    Thanks
    5
    Qt products
    Platforms
    Windows

    Default Re: Number of tick marks on the axis in QBarCategoryAxis.

    Thank you, I did all this earlier.
    Maybe you can still change the labels for the axes?

Similar Threads

  1. Replies: 4
    Last Post: 4th September 2012, 20:28
  2. Replies: 1
    Last Post: 5th March 2012, 07:34
  3. qslider fixed to tick marks
    By holst in forum Qt Programming
    Replies: 4
    Last Post: 24th July 2009, 13:18
  4. QSlider with tick marks numbers
    By mastupristi in forum Qt Programming
    Replies: 3
    Last Post: 6th July 2009, 09:32
  5. QSlider with a custom set of labels for the tick marks?
    By whitefurrows in forum Qt Programming
    Replies: 3
    Last Post: 5th August 2007, 17:05

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.