Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. updating Chart
Qt 6.11 is out! See what's new in the release blog

updating Chart

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 429 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jan Menssen
    wrote on last edited by
    #1

    Dear all

    I have created a QT application (C++) which has a number of QCharts on a GridLayout (using ChartView).
    This creation is done in a loop, During the creation, the number of layouts in the grid is not known, this is only known at the end of the loop and creation.

    In the charts I am using QLineSeries and QScatterSeries. This works quite well. However before the application is really. started I want to add some text in one of these chart.
    I implemented this by mapping this on one of the points in the QScatterSeries (MaptoPosition). However at that moment the QChart.size is still unknown so mapping is impossible ?

    If the application is popped up and for instance I pressed a menu or toolbar, the Qchart.size is known and everything seems to work fine. So my question is the sequence of events that is generated during startup and at which point I the size of the Charts are known.

    Another point is after every resize the mapping should be calculated again. How should I overrule the resize function of Qchart? Or is it possible the text positions automatically with the QChart (as the axis do). In fact I think this is the same as with a detached legend.

    Kind regards - Jan Menssen

    JonBJ 1 Reply Last reply
    0
    • J Jan Menssen

      Dear all

      I have created a QT application (C++) which has a number of QCharts on a GridLayout (using ChartView).
      This creation is done in a loop, During the creation, the number of layouts in the grid is not known, this is only known at the end of the loop and creation.

      In the charts I am using QLineSeries and QScatterSeries. This works quite well. However before the application is really. started I want to add some text in one of these chart.
      I implemented this by mapping this on one of the points in the QScatterSeries (MaptoPosition). However at that moment the QChart.size is still unknown so mapping is impossible ?

      If the application is popped up and for instance I pressed a menu or toolbar, the Qchart.size is known and everything seems to work fine. So my question is the sequence of events that is generated during startup and at which point I the size of the Charts are known.

      Another point is after every resize the mapping should be calculated again. How should I overrule the resize function of Qchart? Or is it possible the text positions automatically with the QChart (as the axis do). In fact I think this is the same as with a detached legend.

      Kind regards - Jan Menssen

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @Jan-Menssen
      Sizes are not known till widgets are rendered. Either override showEvent() or resizeEvent(), or do your work from QTimer::singleShot() to give time for the widget to be shown.

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jan Menssen
        wrote on last edited by
        #3

        using a one shot timer works, thanks

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved