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. how to adjust the distance between axis and chart in QChart
Qt 6.11 is out! See what's new in the release blog

how to adjust the distance between axis and chart in QChart

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 1.4k 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.
  • johnson54J Offline
    johnson54J Offline
    johnson54
    wrote on last edited by
    #1

    when adding axis to a QChart, I use addAxis(axis, Qt::AlignLeft), how to adjust the distance between the axis and the chart, I want to shorten the blank.
    thanks

    jsulmJ 1 Reply Last reply
    0
    • johnson54J johnson54

      when adding axis to a QChart, I use addAxis(axis, Qt::AlignLeft), how to adjust the distance between the axis and the chart, I want to shorten the blank.
      thanks

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @johnson54 Maybe https://doc.qt.io/qt-5/qchart.html#margins-prop ?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      johnson54J 1 Reply Last reply
      0
      • jsulmJ jsulm

        @johnson54 Maybe https://doc.qt.io/qt-5/qchart.html#margins-prop ?

        johnson54J Offline
        johnson54J Offline
        johnson54
        wrote on last edited by
        #3

        @jsulm thanks, but 'setmargin' is usable for setting the distance between the plot area border and the plot, not the distance between the axis and the chart

        1 Reply Last reply
        0
        • johnson54J Offline
          johnson54J Offline
          johnson54
          wrote on last edited by
          #4

          these code are from Qt Charts Examples Logarithmic Axis Example:
          QValueAxis *axisX = new QValueAxis();
          axisX->setTitleText("Data point");
          axisX->setLabelFormat("%i");
          axisX->setTickCount(series->count());
          chart->addAxis(axisX, Qt::AlignBottom);
          series->attachAxis(axisX);

          I want to put the label "Data point" closer to the axis, how to do this?

          1 Reply Last reply
          0
          • R Offline
            R Offline
            rhb327
            wrote on last edited by
            #5

            Did you ever determine a method for this? Similar issue on a -90 label not sizing correctly with label format, etc.

            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