Pivot Chart - plFunctionAverage

E

Effie

I've created pivot chart, working fine.
I need to change the default "SUM" for the data axis to "plFunctionAverage"
(from the help file, under PivotTotalFunctionEnum ), but i can not access
the property.

TIA, Effie
 
A

Alvin Bruney [Microsoft MVP]

how are you trying to access the property?

--
Regards
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
 
E

Effie

ChartSpace1.charts(0).axes(c.chDimValues).GroupingTotalFunction
=c.chfunctionavg


TIA, Effie
 
E

Effie

ChartSpace1.charts(0).axes(c.chDimValues).GroupingTotalFunction
=c.chfunctionavg

TIA, Effie
 
A

Alvin Bruney [Microsoft MVP]

Here is the standard setting code from the help files. If that doesn't help
you, then indicate exactly what type of error you are getting:
Sub FormatTimeScaling()

Dim chConstants
Dim axCategory

Set chConstants = ChartSpace1.Constants

' Change the chart to a Line chart.
ChartSpace1.Charts(0).Type = chConstants.chChartTypeLine

' Set a variable to the category axis.
Set axCategory =
ChartSpace1.Charts(0).Axes(chConstants.chAxisPositionCategory)

' Specify that you will determine the grouping settings of the
' axis. Note that this line of code is necessary only if the
' GroupingType property for the axis has been previously set to
' chAxisGroupingNone.
axCategory.GroupingType = chConstants.chAxisGroupingManual

' Group the category axis by month.
axCategory.GroupingUnitType = chConstants.chAxisUnitMonth

' Create a new grouping for every month.
axCategory.GroupingUnit = 1

' Display the average of the items in each group.
axCategory.GroupingTotalFunction = chConstants.chFunctionAvg

' A tick label is displayed for every month.
axCategory.TickLabelUnitType = chConstants.chAxisUnitMonth

' A tick mark is displayed for every three months.
axCategory.TickMarkUnitType = chConstants.chAxisUnitQuarter

End Sub

--
Regards
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
 

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

Similar Threads


Top