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 set a series of strings as x-axis in QChart?

How to set a series of strings as x-axis in QChart?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 2.5k Views 1 Watching
  • 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.
  • R Offline
    R Offline
    Richard Lee
    wrote on last edited by
    #1

    I have a series of strings in the x column, and corresponding values in the y column. I want to plot y versus x in a line chart, and I want each neighboring x labels has the same interval. How can I achieve this? Thank you.

    FlotisableF 1 Reply Last reply
    0
    • R Richard Lee

      I have a series of strings in the x column, and corresponding values in the y column. I want to plot y versus x in a line chart, and I want each neighboring x labels has the same interval. How can I achieve this? Thank you.

      FlotisableF Offline
      FlotisableF Offline
      Flotisable
      wrote on last edited by
      #2

      @Richard-Lee
      maybe this example meets your need.

      1 Reply Last reply
      1
      • R Offline
        R Offline
        Richard Lee
        wrote on last edited by
        #3

        Thank you very much. I have solved my problem after read through the example.

        Actually, I should have three columns. the first column is just a series of sequential integer numbers, the second column stores the cateogories, which will be appeared as the x axis labels, and the third column stores y-axis values. Then I create a QBarCategoryAxis, e.g. xAxis, then I append the xAxis with the categories column, and link the xAxis with my line series (i.e. setAxisX(xAxis, series).

        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