Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-81759

Add range limitation feature to QValueAxis

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 5.14
    • Charts
    • None
    • All

    Description

      I have some use cases where none of the displayed series could have any data in a specific range of a one of the horizontal/vertical axes.

      For e.g. I only display positive data with the series.

      When zooming and scrolling of the chart is enabled it would be useful if these operations could respect a limitation set on the axes itself.

      I am thinking about adding the following API to the QValueAxis:

      • void setLowerRangeLimit(bool enabled, qreal limitValue = 0.0)
      • void setLowerRangeLimit(bool enabled, qreal limitValue = 0.0)
      • bool lowerRangeLimitEnabled() const;
      • bool upperRangeLimitEnabled() const;
      • qreal lowerRangeLimit() const;
      • qreal upperRangeLimit() const;

      At the moment I workarounded this issue by deriving a class from QValueAxis and keeping a list from the limited axes in my zooming/panning logic, however it could be more elegant if it would be builtin to the QValueAxis.

       Please let me know what do you think about this change. If I got positive feedback I have the willingness of implementing it.

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            e0348803 Miikka Heikkinen
            martonmiklos Miklós Márton
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes