Programatically (C#) applying data to multiple axis Graph in PPT

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have created an application that pulls data and output the data to a graph
on a PPT slide. I have ran into an issue trying to plot data on more than one
axis. Can anyone shed some light on this for me?

Thanks,

Racter
 
I have created an application that pulls data and output the data to a graph
on a PPT slide. I have ran into an issue trying to plot data on more than one
axis. Can anyone shed some light on this for me?

Not if we have to guess what the "issue" is.

Fill in some details and we'll give it a go though.


--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Featured Presenter, PowerPoint Live 2004
October 10-13, San Diego, CA www.PowerPointLive.com
================================================
 
Problem is I am unable to identify the interface to the graph that allows me
to state what data in the datasheet goes on which axis. If I manually edit
the graph in Powerpoint I can then change the axis. I nned to automate this.
Documentation for the graph component is not much help.

Thanks.
 
Racter,

Sub TestCode()
Call MoveSeriesToSecondaryAxes(ActiveWindow.Selection.ShapeRange(1), 2)
End Sub

Sub MoveSeriesToSecondaryAxes(oChartShape As Shape, SeriesIndex As Integer)

Dim oChart As Object 'Chart

' Get the reference to the Chart object.
Set oChart = oChartShape.OLEFormat.Object
' Move specified series to secondary axis, works with 2D charts only,
' add necessary error checks
oChart.SeriesCollection(SeriesIndex).AxisGroup = 2

' Update the graph and quit the graph application
oChart.Application.Update
oChart.Application.Quit
Set oChart = Nothing

End Sub


--
Regards
Shyam Pillai

Toolbox: http://www.mvps.org/skp/toolbox/
 
Problem is I am unable to identify the interface to the graph that allows me
to state what data in the datasheet goes on which axis. If I manually edit
the graph in Powerpoint I can then change the axis. I nned to automate this.
Documentation for the graph component is not much help.

I'd start by trying to do the job in Excel, even recording a macro there as you do
it manually. An awful lot of what happens to charts in Excel applies to MSGraph
charts as well.



--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Featured Presenter, PowerPoint Live 2004
October 10-13, San Diego, CA www.PowerPointLive.com
================================================
 
Back
Top