auto range for chart y values is zero

On Aug 30, 2017 6:41 PM, rgb99 made this post. "I have a simple spreadsheet with 1 column of 5 numbers and a header column with the names. There is one header row with empty cells. The numbers are currency values ranging from 60.50 to 76.01 and when I plot these as a 2d line the chart has a y range of 0 to 80 when both axes are set to auto. The minimum y value should be 60 not 0. This behaviour has shown up in other spreadsheets but not consistently. Anyone have an idea why Numbers is using 0 as the minimum rather than a value close to 60?"


Now 3 years later I am having the same problem.


I chart stocks from a single row in my spread sheet. That row is populated setting a check mark by the stock I want to analyze, Some of these stocks are priced below $10 and others, TSLA for example is over $400. The Y value is set to "0" in all cases which distort and virtually make the chart useless with out changing the chart from auto scale to a value from the stock data. For 1 or 2 stocks this is not a problem but for many more it becomes a real time consuming problem.


Apple Support has been very supportive but the Numbers Engineers think this is perfectly ok. They some how think it is ok to set maximum based on the data but see no value in setting the minimum based on the data.


Apple Support has submitted this problem a couple of times but the developers response is always, "that's the way it is supposed to work!"


Does anyone know how to set minimum value based on the data?


Thanks

Posted on Oct 25, 2020 10:52 AM

Reply
Question marked as Top-ranking reply

Posted on Oct 25, 2020 3:27 PM

If you normalize the data before charting it, the lowest value of the dataset being charted will be transformed into a 0 and the highest into a 1. Or, for a better looking chart, the lowest data point could slightly above 0 and the highest slightly below 1 so there is some room above and below on the chart. The chart would be set manually to have a minimum of 0 and a maximum of 1 and a given number of steps. All of this will be the same for whatever dataset you chart.


The Y values on the chart (0 up to 1) will have no relationship to the actual values being charted so you want to turn them off. With a 1-column table in place of the Y values, you can create your own Y values. It is simple to put a min and max on the axis but it would take some cleverness to create a min and max that would work out well for the number of steps. So in this example below I left off all the intermediate numbers. Actually, it takes a little more cleverness than my formulas to make a good min and max for the chart. The ones for "CDE" company aren't that great.



Columns A-D are all typed in data except the two footer rows that use the MIN and MAX formulas.


E2 =INDEX($2:$2,MATCH(TRUE,$1:$1,0))

looks for the checked box and copies over the company name


E3 =(INDEX(3:3,MATCH(E$2,$2:$2,0))−E$6)÷(E$7−E$6)

Brings over the value for this row and normalizes it using the min and max in the footer rows.

To complete the column, fill down from E3 to the last data row (not into the footer rows)


E6 =INDEX(6:6,MATCH(E$2,$2:$2,0))×90%

E7 =INDEX(7:7,MATCH(E$2,$2:$2,0))×110%

These are values used for normalizing the data for the chart.


The table to the left of the chart references the values in E6 and E7 of Table 1. The gridlines, table name, table outline are turned off. When you click off of the table it disappears other than the min and max values. I clicked on it so you could see it in the screenshot.


I did not know how your table was set up. The example above is just to show how it can be done.



14 replies
Question marked as Top-ranking reply

Oct 25, 2020 3:27 PM in response to The-Old-Guy

If you normalize the data before charting it, the lowest value of the dataset being charted will be transformed into a 0 and the highest into a 1. Or, for a better looking chart, the lowest data point could slightly above 0 and the highest slightly below 1 so there is some room above and below on the chart. The chart would be set manually to have a minimum of 0 and a maximum of 1 and a given number of steps. All of this will be the same for whatever dataset you chart.


The Y values on the chart (0 up to 1) will have no relationship to the actual values being charted so you want to turn them off. With a 1-column table in place of the Y values, you can create your own Y values. It is simple to put a min and max on the axis but it would take some cleverness to create a min and max that would work out well for the number of steps. So in this example below I left off all the intermediate numbers. Actually, it takes a little more cleverness than my formulas to make a good min and max for the chart. The ones for "CDE" company aren't that great.



Columns A-D are all typed in data except the two footer rows that use the MIN and MAX formulas.


E2 =INDEX($2:$2,MATCH(TRUE,$1:$1,0))

looks for the checked box and copies over the company name


E3 =(INDEX(3:3,MATCH(E$2,$2:$2,0))−E$6)÷(E$7−E$6)

Brings over the value for this row and normalizes it using the min and max in the footer rows.

To complete the column, fill down from E3 to the last data row (not into the footer rows)


E6 =INDEX(6:6,MATCH(E$2,$2:$2,0))×90%

E7 =INDEX(7:7,MATCH(E$2,$2:$2,0))×110%

These are values used for normalizing the data for the chart.


The table to the left of the chart references the values in E6 and E7 of Table 1. The gridlines, table name, table outline are turned off. When you click off of the table it disappears other than the min and max values. I clicked on it so you could see it in the screenshot.


I did not know how your table was set up. The example above is just to show how it can be done.



Oct 25, 2020 8:02 PM in response to The-Old-Guy

There's a trade-off here, considering that Numbers is used to graph many other things besides stock prices.


See the "truncated" graph section at https://en.wikipedia.org/wiki/Misleading_graph.


Not relevant to stock prices, but if you're trying to compare series of wildly different values in the same chart, especially to compare rates of change, one thing you can do is set an axis scale to Logarithmic.


SG

Oct 26, 2020 5:35 AM in response to SGIII

My goal with Numbers is to use data and the charts to filter out the “dogs” and identify those that merit further research!


As I researched this I found that people have been complaining about this for a long time. Apple phone support have taken the problem seriously and have sent it to Engineering/Development twice. The developers only say, “that’s the way it is supposed to be.”


Because of that I assume this is an unsolvable problem.

Oct 27, 2020 4:51 PM in response to Badunit

Badunit, I have been looking at your example and having a bit of problem recreating it, In this problem I use 2 tables to create the chart. I am including them. I used an "IF" to determine the find the row with a checkmark. I want to look at your method it may be a lot better! (later, not now!). The screenshots are just for reference. I would like to know how you created the table and chart in your example. Sorry to be so "thick" but the Mac and Numbers are really new to me.


Best regards,


tom


This is a 50 column table. Just showing the first few.


A4, "AAPL" is where I check for the checkbox.


Oct 25, 2020 12:45 PM in response to The-Old-Guy

There is no way I know of to override the algorithm. Your statement about it not setting he min (low point) based on the data is incorrect, though. It does set the min (low point) based on the data but once the high point vs low point gets above a certain threshold, it drops the min to zero. Excel does pretty much the same thing as best I can tell. It looks to be roughly around a 16% difference but the algorithm may be more complex than just going by a percentage difference.


There is more than one problem with trying to plot wildly different values on the same chart. Aside from the min/max not always being what you might like, the number of gridlines (steps) is often not ideal either and the Y axis values often come out to unusual numbers. So, not only do you have to set max and min, you also need to set the number of steps when you are plotting wildly different values using the same chart.


One thing you could do is normalize the data so, regardless of the stock, the "normalized" data that will be charted is all in the same range. You would have to turn off your Y axis values because they won't make sense. You could replace the Y axis values with a 1-column table of values that you calculate for each gridline.

Oct 27, 2020 6:32 PM in response to The-Old-Guy

You need to chart normalized data. Values between 0 and 1 is typically what that means. For that you need to come up with a formula to determine how to normalize your data. In my example, I found the minimum and maximum of the dataset, multiplied the min by 90% and the max by 110%, then used this equation:


Normalized datapoint = (actual datapoint - min)/(max-min)


So, in your "50 column table", below the row that has AAPL (which I assume is row 3), add a new row (row 4), put this formula in B4 then fill right:

=(B3-90%*MIN(3:3))/(110%*MAX(3:3)-90%*MIN(3:3))


Make your chart from row 4 instead of row 3. Don't show the Y axis values. Set the min of the chart to 0 and the max to 1 and whatever number of steps you want. Make a 1-column table to use as the new Y values. Resize it so the text in the cells line up with the gridlines. You will probably only put the min and max values because it will be difficult if not impossible for all the steps to be "nice" numbers.


SGIII has an exceptional point about misleading charts. The simple normalization algorithm I am using here will create misleading charts. A stock that changes by hundreds of percent and one that changes by hundredths of a percent may look exactly the same on the chart. You should come up with a better algorithm. Really, this one is not good for what you want to do. I think you want to plot your data linearly. I think linear is typical for stock charts. That means you need a better method to calculate the min and/or max. Maybe you set the min similarly to how I did above and the max is a percentage (100%, 200%, or something else) above it. You might need to put that percentage in a cell that you can edit in case the stock you are looking at went wild.



This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

auto range for chart y values is zero

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.