How to add multiple data fields to a pivot chart

H

Hui

I need to create a pivot chart linked to data in a SQL
Server table. But I am having trouble adding multiple data
series into the chart. Please help:

c = chartspace1.constants
chartspace1.ConnectionString
= "Provider=SQLOLEDB.1;Integrated Security=SSPI;Initial
Catalog=TT;Data Source=sql1;"
chartspace1.DataMember = "dbo.Gantt_Test"
chartspace1.Charts(0).type = c.chChartTypeBarStacked

//This works, add two categories
chartspace1.setdata c.chDimCategories,0, array
(chartspace1.internalpivottable.activeview.fieldsets
("Name").fields("Name"),
chartspace1.internalpivottable.activeview.fieldsets
("Completed").fields("Completed"))

//But this does not work, Invalid procedure call or
argument
chartspace1.setdata c.chDimValues,0, array
(chartspace1.internalpivottable.activeview.fieldsets
("Totals").fields("start qty"),
chartspace1.internalpivottable.activeview.fieldsets
("Totals").fields("end qty"))

//This works, add one data fields
chartspace1.setdata c.chDimValues,0,"start qty"
 
T

Thao Moua [ms]

Add this before you set your array of value data

chartspace1.plotallaggregates = c.chPlotAggregatesSerie
chartspace1.setdata c.chDimValues,0, array(chartspace1.internalpivottable.activeview.fieldsets("Totals").fields("start qty"), chartspace1.internalpivottable.activeview.fieldsets("Totals").fields("end qty")

Thao Mou
OWC Webchart Suppor

This posting is provided "AS IS" with no warranties, and
confers no rights. Use of included script samples are
subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
 

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