Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Algorithms
  4. Get X Axis label and interval

Get X Axis label and interval

Scheduled Pinned Locked Moved Algorithms
algorithmstutorial
3 Posts 2 Posters 0 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.
  • N Offline
    N Offline
    NJdotnetdev
    wrote on last edited by
    #1

    Hi All, I am trying to come up with an algorithm to get following three piece of information to plot a chart: 1. Start : Should be close to the minimum value of the dataset 2. Stop : Should be close to the maximum value of the dataset 3. Interval : Should be such that it will have "0" on the axis when interval traverses from minimum to maximum. Example: dataset{-266,-17.6,0.5,2000,6000} My final return values should be: Start: 400 Stop: 6000 Interval:200 Note: Since start is 400 and interval is 200, we will have 0 as a point on the x-axis.

    L 1 Reply Last reply
    0
    • N NJdotnetdev

      Hi All, I am trying to come up with an algorithm to get following three piece of information to plot a chart: 1. Start : Should be close to the minimum value of the dataset 2. Stop : Should be close to the maximum value of the dataset 3. Interval : Should be such that it will have "0" on the axis when interval traverses from minimum to maximum. Example: dataset{-266,-17.6,0.5,2000,6000} My final return values should be: Start: 400 Stop: 6000 Interval:200 Note: Since start is 400 and interval is 200, we will have 0 as a point on the x-axis.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      How did you choose 400 to be 'close' to -266? Plotting the values from 400 to 6000 in intervals of 200 is a simple straight line. Your question is not clear.

      N 1 Reply Last reply
      0
      • L Lost User

        How did you choose 400 to be 'close' to -266? Plotting the values from 400 to 6000 in intervals of 200 is a simple straight line. Your question is not clear.

        N Offline
        N Offline
        NJdotnetdev
        wrote on last edited by
        #3

        400 value is in example. I came up with those numbers to explain what I am trying to achieve. Actually, I did figure this out. Thanks.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups