Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Multyplying QChart Legends By a constant
Qt 6.12 LTS is out! See what's new in the release blog

Multyplying QChart Legends By a constant

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 499 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.
  • D Offline
    D Offline
    darkp03
    wrote on last edited by
    #1

    Hi everyone!

    Im working on an aplication that makes Graphs about Scattering parameters.

    This graphs may be in function of the frequency, or in function of the time.
    Frecuencies go from Hz to GigaHz
    Seconds go from Seconds to nanoseconds.

    In my program, I express all of the Frecuencies on Hertz, and all of the Times on seconds, using a double variable.

    That means, that If i want to store 10 ns, my variable woluld be 0,00000001
    If i want to store 5 MHz, my variable would be 5000000

    Here goes a screenshot of one of my graphs.

    0_1527530019204_Grafico.jpg

    This graph goes from -1.3 ns to 1.3 ns

    The question.

    I would like the legend to show exactly that "-1.3 to 1.3" and the on the AxisX I would write (Time [ns])
    Basically, I would need all of the text in the labels to be multiplied by 1000000000.

    I know that this could be done differently. When im adding the points, I could simply multiply each value with the constant. But thats not what I want.
    I want the points to be stored in the graph with their REAL value (on Hz, or Seconds, and loads of decimal points)
    I want the scale to show a smart value.
    What i mean by smart value?
    If the time is bigger than 1. Then leave the value and on the title express Seconds
    If the time is between 1 and 0.001, multiply it by 1000 and on the title express Miliseconds
    If the time is between 0.001 and 0.000001. multiply it by 1000000 and on the title express Microseconds

    I need a way to alter the labels without editing the information of each point.

    Any ideas? Could someone point me in the correct direction?
    Thanks in advance

    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
    • Unsolved