Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6609087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:40:43+00:00 2026-05-25T19:40:43+00:00

I am attempting to replicate how ‘right’ Excel feels with regards to calculating the

  • 0

I am attempting to replicate how ‘right’ Excel feels with regards to calculating the Y-Axis boundaries for a line chart.

As an example, lets assume I currently have a chart with three datapoints on it. (0, 100), (1,500), (2,930).

The simplistic code I currently have sets the Y-Axis min value to 100 and the Y-Axis max value to 930. The idea was to prevent datasets which have no 0 values from skewing the size of the chart. This works, but I feel that it could be much better.

For the above example, Excel plots the datapoints on the range 0 through 1000. I am trying to create a general algorithm plotting the same ‘feel good’ range. It is proving to be slightly tricky, however.

I feel that I need a few points of information:

  • The order of magnitude for the upper and lower values (power of 10).
  • Always take the ceiling / floor of a data point — it is not very clear when a data point shares the same value as max/min range plotted.

From there I’m at a bit of a loss.

If I take 930 as a max data point value, I know it’s order of magnitude is 3. So, I add one to its largest value and zero the rest — resulting in 1000.

If I take 1030 as a max data point value, I know it’s order of magnitude is 4. If I add one to it’s largest value and zero the rest the result is 2000. Excel plots 1200 as the max range when graphing (0, 100), (1,500), (2,930), (3,1030).

This problem quickly degrades at larger values — it’s just not quite right to always increase the largest value, but it is sometimes. Does anyone have any experience with this that could shed some insight into a better approach?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:40:43+00:00Added an answer on May 25, 2026 at 7:40 pm

    Why not just have the range going from something like:

    (1-padding) * minimum_value // minimum > 0
    (1+padding) * minimum_value // minimum < 0
    

    to

    (1+padding) * maximum_value // maximum > 0
    (1-padding) * maximum_value // maximum < 0
    

    where padding is a number between 0 and 1, e.g. 0.05.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having issues attempting to replicate a chart that has been generated in
Attempting to use the data series from this example no longer passes the JSONLint
I'm attempting to replicate the Facebook app's new menu slider. Creating a slider that
I am attempting to make a Facebook game and trying to replicate a common
I have a function in C++ that I am attempting to replicate in delphi:
Attempting the most basic example of Knockout.js possible on their documentation page: http://knockoutjs.com/documentation/observables.html Looks
Attempting to insert an escape character into a table results in a warning. For
Attempting to print out a list of values from 2 different variables that are
Attempting to deploy a MOSS solution to a UAT server from dev server for
Attempting to make a NSObject called 'Person' that will hold the login details for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.