+ Reply to Thread
Results 1 to 6 of 6

How to plot 2 chart types on one graph in vba

  1. #1
    Registered User
    Join Date
    02-16-2012
    Location
    sa
    MS-Off Ver
    Excel 2007
    Posts
    80

    How to plot 2 chart types on one graph in vba

    Good day,

    I would like to create a chart in vba which contains 2 sets of data, both using the same x axis. The first must be a line graph, the second a staggered bar chart. This must be represented on one chart with data labels. Also, how do I change the colour of the plots?

    Thank you

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How to plot 2 chart types on one graph in vba

    So is the question how do I show both a line series and a bar series on the same chart?

    Just select the series in question and use the Change Chart Type to select the type required.

    Changing the colour of the plot points (markers) or lines / fill areas is just a question of selecting the appropriate object and formatting it accordingly.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    02-16-2012
    Location
    sa
    MS-Off Ver
    Excel 2007
    Posts
    80

    Re: How to plot 2 chart types on one graph in vba

    Yes, but how do I do this in VBA?

  4. #4
    Spammer
    Join Date
    01-26-2010
    Location
    Worcester MA
    MS-Off Ver
    Excel 2003
    Posts
    184

    Re: How to plot 2 chart types on one graph in vba

    ActiveChart.SeriesCollection(1).ChartType = xlLineMarkers
    ActiveChart.SeriesCollection(2).ChartType = xlColumnClustered
    Jon Peltier
    http://PeltierTech.com/

  5. #5
    Registered User
    Join Date
    02-16-2012
    Location
    sa
    MS-Off Ver
    Excel 2007
    Posts
    80

    Re: How to plot 2 chart types on one graph in vba

    Thanks but this doesnt seem to work. Can you show me how to use the above syntax in an example?

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

    Re: How to plot 2 chart types on one graph in vba

    Why don't you post any example file. Manually create the chart so we can see what you actually need.
    Cheers
    Andy
    www.andypope.info

+ 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. Chart - Aligning a Scatter plot w/bar graph data
    By bettbacker03 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 06-24-2013, 08:38 PM
  2. [SOLVED] Combining chart types in one plot area
    By Glenn Kennedy in forum Excel General
    Replies: 3
    Last Post: 07-28-2012, 02:16 PM
  3. Changing the plot order of chart types in excel VBA
    By Ray Piscopo in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-01-2012, 05:19 AM
  4. Plot points on a area chart or plot areas on a scatter chart
    By maggy in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 01-17-2012, 04:39 AM
  5. combination chart (different graph types)
    By Piet L. in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 01-22-2005, 11:06 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