+ Reply to Thread
Results 1 to 3 of 3

Line Chart - Aligning the Horizontal Axis at Y=0 on Both Vertical Axes

  1. #1
    Forum Contributor
    Join Date
    02-08-2005
    MS-Off Ver
    Microsoft 365
    Posts
    810

    Line Chart - Aligning the Horizontal Axis at Y=0 on Both Vertical Axes

    Hi,

    In the attached workbook I have created a Combo Box from which a user can select a product; this choice will determine the content of the line chart.

    I would like to align the horizontal axis to Y=0 on both of the Y-axes.

    I can do this manually but this isn't a feasible solution as the Combo Box could potentially contain dozens of products.

    Can someone please suggest a better way to align the axes?

    If this is to be a VBA solution is it possible to trigger the code to align the axes each time a product is selected in the Combo Box?

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,827

    Re: Line Chart - Aligning the Horizontal Axis at Y=0 on Both Vertical Axes

    I can see two approaches:

    1) VBA to set both the primary and secondary axis limits and major unit to get the desired effect. This procedure could easily be part of or called from a change/calculate event procedure to further automate it. This is an old one (back before Excel 2007), but the basic idea should still apply: https://peltiertech.com/Excel/Charts/AlignXon2Ys.html

    2) "Fake" the secondary axis with a dummy XY scatter series. Basically a variation of this technique: https://peltiertech.com/secondary-ax...tional-scales/

    Which approach do you like?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Contributor
    Join Date
    02-08-2005
    MS-Off Ver
    Microsoft 365
    Posts
    810

    Re: Line Chart - Aligning the Horizontal Axis at Y=0 on Both Vertical Axes

    Thanks very much - I'll take a look to see which I can get to work for me.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] create x-axis and a y-axis chart as an image horizontal and vertical values
    By Khaldon in forum Excel Charting & Pivots
    Replies: 9
    Last Post: 10-11-2018, 09:12 AM
  2. Replies: 1
    Last Post: 06-18-2014, 04:32 PM
  3. [SOLVED] How to draw a chart horizontal axis and vertical axis
    By kiany406 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 09-17-2012, 02:56 PM
  4. Aligning horizontal 0 axis, chart with two axis
    By Harlort in forum Excel Charting & Pivots
    Replies: 10
    Last Post: 02-10-2011, 08:54 AM
  5. Replies: 6
    Last Post: 12-07-2010, 02:54 PM
  6. Adding a horizontal line to a chart that already has 2 axes?
    By Nakia6 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 10-27-2009, 02:04 PM
  7. Chart using one column as vertical axis and others on horizontal axis!!!
    By nandhamnk in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 11-28-2007, 09:40 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1