Re: Better control of axis ranges

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



For some complex charts, I use a process that completely rescales
everything. It's what graphics packages do behind the scenes, but I use it
in the worksheet to give me ultimate control.

I start by determining min and max values I'll need on an axis. I have
algorithms to choose "nice" axis min, max, and tick spacing values. It's
related to Stephen Bullen's VBA approach:

http://groups.google.com/group/microsoft.public.excel.charting/browse_thread/thread/8990f365efcd2943/8a13d5257af6a8c7?lnk=st&q=autoscale+axis+group%3A*excel*+author%3Abullen&rnum=1&hl=en#8a13d5257af6a8c7

but I do it in the worksheet. Then given these calculated limits, I rescale
the series data from 0 to 1 so that 0 corresponds with the calculated min
and 1 to the calculated max; the axis is then locked into a scale of 0 to 1.
That's the data. Then I use this technique from my web site:

http://peltiertech.com/Excel/Charts/ArbitraryAxis.html

to add the required axis ticks and labels. No VBA is required, because the
axis scale doesn't change. It sounds like a lot of work, but it's reliable
and flexible, and I can use this to create charts with great complexity,
showing several sections, like the stock charts in the newspaper with prices
in one section, lined up with volume in another, and perhaps a comparison of
various indices in yet another section. If I want to add a section, or
change the relative height of one, it is merely a matter of tweaking a few
parameters in the cells, and all of the scaling occurs automatically.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services - Tutorials and Custom Solutions -
http://PeltierTech.com/
2006 Excel User Conference, 19-21 April, Atlantic City, NJ
http://peltiertech.com/Excel/ExcelUserConf06.html
_______

"hmm" <hmm@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:53D24794-DB07-4ABA-B16F-3204FFEEB60B@xxxxxxxxxxxxxxxx
I would like to make x-y charts in Excel 2000 with dynamic source data.
That
is, the user can select what data set he wants to display.

To do this, I need better control of how the axis limits are defined.
This
can be achieved in one of two ways:

1. Use numbers from cells to define xmin, xmax, ymin, ymax.
2. Define in some way how auto-scaling decides what the min and max values
are (I often find that the data gets "scrunched" into a small portion of
the
plot area).

Method 1 is preferred, but 2 may also work. I would prefer to do this
without writing a VBA macro, if possible.

Does anyone know if this can be done?


.



Relevant Pages

  • Re: Dynamic Charts Problem
    ... charts not updating, and I've never experienced it first hand. ... Jon Peltier, Microsoft Excel MVP ... The cells on the worksheet where the chart is ... The reference never changes to the workbook, ...
    (microsoft.public.excel.charting)
  • Re: Dynamic Charts Problem
    ... The cells on the worksheet where the chart is ... The reference never changes to the workbook, ... If you use worksheet-scoped names, this corruption doesn't occur. ... If you save, close, and reopen the workbook with corrupted charts, ...
    (microsoft.public.excel.charting)
  • Re: Ho do I resize multiple charts?
    ... moved them to their own sheets. ... A worksheet is the kind of sheet with rows and columns. ... What version of Excel are you using? ... My spreadsheet has each week of the year, and each week has two charts on ...
    (microsoft.public.excel.charting)
  • Re: Show Data Table Only
    ... Set up a centralized worksheet. ... so the data on the centralized sheet links to the ... Jon Peltier, Microsoft Excel MVP ... The boss now wants to do away with the charts and ...
    (microsoft.public.excel.charting)
  • Re: Appearance of linked excel worksheets in word
    ... You could try adding a charformat switch to the link field which will stop ... the changes when you update the field, but I suspect the problem is simply ... charts - others the double underlining appears exactly as it should). ... document on the one worksheet so all the worksheet settings in word ...
    (microsoft.public.word.docmanagement)