+ Reply to Thread
Results 1 to 16 of 16

Excel 2007 : Chart able to differentiate primary and secondary axis

  1. #1
    Registered User
    Join Date
    07-12-2010
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    9

    Chart able to differentiate primary and secondary axis

    Hi all,

    I am trying to create an excel that is able to graph dynamically across multiple worksheet data into one chart. I have 3 Sheets(Graph, PrimaryData, SecondaryData).

    The sheets("Graph"), will create a Line Chart which takes data from the sheet("PrimaryData") and plot into the primary axis.

    Likewise the data from the sheet("SecondaryData") goes into the secondary axis.

    Thanks in advance and hear from you soon!
    Last edited by iamgliang; 07-23-2010 at 03:43 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Chart able to differentiate primary and secondary axis

    Data from different sheets
    http://peltiertech.com/Excel/ChartsH...iffSheets.html

    Dynamic charts
    http://peltiertech.com/Excel/Charts/Dynamics.html

    The simplest approach is to create a consolidated chart sourder from the disparate data sources.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    07-12-2010
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Chart able to differentiate primary and secondary axis

    Hi Andy,

    thanks for the link.

    What do you mean by creating a consolidated chart sourder?

    I have tried using the link that you posted, but I am still facing problems. Currently, I am able to add data from Sheet("PrimaryData") into the chart in Sheet("graph"). Dynamically, the Chart is able to update once there's a change in worksheet("PrimaryData").

    However, i am not able to figure out how to insert the data from worksheet("SecondaryData").to the existing Chart in worksheet("Graph") and how to update dynamically if there's a change in the worksheet("SecondaryData")

    Another problem I faced is, how am I going to set Data from worksheet("PrimaryData") to be based on primary axis and worksheet("SecondaryData") based on secondary axis.

    Please assist me on this part. I have attached the excel worksheet for your reference.

    Cheers !
    Attached Files Attached Files

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Chart able to differentiate primary and secondary axis

    I meant to type source.

    No need for any code just use the named ranges. But rather than define the complete data source define the label and each data series separately.
    Attached Files Attached Files

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Chart able to differentiate primary and secondary axis

    Your post does not comply with Rule 8 of our Forum RULES. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us help you!

    Read this to understand why we ask you to do this

  6. #6
    Registered User
    Join Date
    07-12-2010
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Chart able to differentiate primary and secondary axis

    I'm sorry.. din know about the rules.. will not do it again

  7. #7
    Registered User
    Join Date
    07-12-2010
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Chart able to differentiate primary and secondary axis


  8. #8
    Registered User
    Join Date
    07-12-2010
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Chart able to differentiate primary and secondary axis

    Hi Andy,

    The method that you have shown is to set individually to name manager. However, I need the both worksheets("primaryData") and ("secondaryData") to update dynamically once there's a new series without the hassle to add the name manager again and again. Is there a solution for this?

    With Regards and Many Thanks,

    iamgliang

  9. #9
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Chart able to differentiate primary and secondary axis

    Dynamic ranges only control the starting point and/or the length of a data series.

    If you want new series to appear you need to use VBA.

  10. #10
    Registered User
    Join Date
    07-12-2010
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Chart able to differentiate primary and secondary axis

    Hi Andy,

    is the any link you have that allows new series to appear using VBA? or you have sample copies with you ?

    Thank you in advance!

  11. #11
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Chart able to differentiate primary and secondary axis

    try using the search on .NewSeries

  12. #12
    Registered User
    Join Date
    07-12-2010
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Chart able to differentiate primary and secondary axis

    Hi Andy,

    I have tried and tested using .NewSeries

    Please Login or Register  to view this content.
    however, this is not dynamic. how can I define it dynamically?

    thanks once again !
    Last edited by iamgliang; 07-26-2010 at 04:19 AM. Reason: to ease for testing.

  13. #13
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Chart able to differentiate primary and secondary axis

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    You can use the .End method to get the data range.

    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    07-12-2010
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Chart able to differentiate primary and secondary axis

    Hi Andy,

    Apologized for not complying rule 3.

    Using .End method is still not dynamic if I have new series to add. Is there a way if I could simply define a .SetSourceData method to get the data range to make the chart dynamic?
    Last edited by iamgliang; 07-26-2010 at 04:26 AM.

  15. #15
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Chart able to differentiate primary and secondary axis

    Maybe you would care to explain what you mean by dynamic?

    As I have said, dynamic ranges can automatically extend existing chart series.
    New chart series would require code to add the series. If the data it is to be based on can subsequently change in size then the reference needs to be a named range.

  16. #16
    Registered User
    Join Date
    07-12-2010
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Chart able to differentiate primary and secondary axis

    Sorry for the typo mistake.

    I meant dynamic series. I am trying to create a chart which will automatically update when a new chart series is been added in both worksheet("primaryData") and worksheet("secondaryData").

    I can't seems to be find the relevant code on the Internet.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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