Two time axis in Pivot chart

C

Carlos

I like to have two categories time axis

one with days and the other with month

i try

Dim oConn As ADODB.Connection
Dim oRS As ADODB.Recordset

sSQL = "SELECT * FROM ChartDATA"

Set oRS= oConn.Execute(sSQL)

oRS.MoveFirst
Dim oCh As ChChart


With ChartSpace1
.Clear
.Refresh
Set .DataSource = oRS
.HasChartSpaceLegend = True
.PlotAllAggregates = chPlotAggregatesSeries

With .ChartSpaceLegend
.Position = chLegendPositionBottom
.Border.Color = chColorNone
.Font.Size = 6
End With

.SetData chDimCategories, 0, oRS.Fields(0).Name
.SetData chDimValues, 0, Array(oRS.Fields(1).Name,
oRS.Fields(2).Name, oRS.Fields(3).Name)

Dim oAxis_d As ChAxis, oAxis_m As ChAxis
Set oAxis_d = oCh.Axes(chAxisPositionCategory)

With oAxis_d
.CategoryLabels.PivotAxis.Fields(0).NumberFormat = "d" ' this OK
.Scaling.Minimum = #7/1/2006#
.Scaling.Maximum = #10/1/2006#
End With

Set oAxis_m = oCh.Axes.Add(oAxis_d.Scaling)

With oAxis_m
.CategoryLabels.PivotAxis.Fields(0).NumberFormat = "MMMM" ' this
revert axis1 to same format
End With

is possible the oAxis_m set the format for month

thank's
 

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

Top