Logarithmic Chart in VBA

  • Thread starter Thread starter jliu3885
  • Start date Start date
J

jliu3885

I would like to know how to set Axis in Graph.Chart, so it will draw a
Logarithmic Chart instead of linear one.

Thx

-----------------------------------
Dim ppoChart As PowerPoint.Shape
Dim mgoChart As Graph

Set ppsCurrent = ppppDOB.Slides.Add((ppppDOB.Slides.Count + 1),
ppLayoutTitleOnly)
Set rstInfo = GetChartInfo(plngDataID)
Set rstData = GetChartData(rstInfo("cmnDoDAACID"),
rstInfo("cmnFuelTypeID"), rstInfo("cmnDFSPTypeAvgSpan"),
rstInfo("dobDataAsOfDate"))

If Not rstData.EOF Then
Set ppoChart = ppsCurrent.Shapes.AddOLEObject(15, 125, 700,
400, "MSGraph.Chart")
Set mgoChart = ppoChart.OLEFormat.Object
mgoChart.ChartType = xlLine ' draw line chart

mgoChart.Axes(xlCategory).CategoryType = xlCategoryScale
'mgoChart.Axes(xlValue). ' ??? how to set axis ???


Thx
 
Right click on the axis to change to log scale and choose
Format Axis. On the Scale Tab, click the Logarithmic
Scale box.

HTH
Kevin Sprinkel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top