Error in SetData OWC 10 Chart connected to Pivot Control

M

Michael Weiss

Hello,
I have a chartspace in which I am trying to present
multiple charts. The chartspace data feed is a OWC pivot
control pulling data from an Analysis Services 2000 data
cube. In the following code, I am getting an error on the
line ".SetData c.chDimSeriesNames, 0, c.chPivotColumns".
The error message simply says 'Unspecified Error'. The
code executes on the client side. Any help or suggestions
would be greatly appreciated.
Thank you,
Michael

Here is the relevant portion of the code:
' Get the active view
set pview = ptable.ActiveView
set pc = ptable.Constants

' Bind the Chart control to the PivotTable control
cspace.clear
set cspace.DataSource = ptable
set c = cspace.Constants
'cspace.PlotAllAggregates = c.chPlotAggregatesCategories
'cspace.PlotAllAggregates = c.chPlotAggregatesSeries

with cspace
..ChartLayout = c.chChartLayoutHorizontal
..displayfieldbuttons = false
..interior.color = "white"
..HasChartSpaceTitle = true
..ChartSpaceTitle.Caption = "Call Type Analysis"
..ChartSpaceTitle.font.color = "#336699"
..ChartSpaceTitle.font.size = 9
..ChartSpaceTitle.Font.Bold = true
'.Border.Color = c.chColorNone
end with

Set cht = cspace.charts(0)
with cht
..haslegend = true
..HasTitle = True
..Title.Caption = "Minutes"
' bind the series and categories dimensions
..SetData c.chDimSeriesNames, 0, c.chPivotColumns 'error
on this line
..SetData c.chDimCategories, 0, c.chPivotRows

' Use the totals for values
..SetData c.chDimValues, 0, 0

..Type = c.chChartTypePieExploded3d
set ax = .Axes(c.chAxisPositionBottom)
set ttl = pview.DataAxis.Totals(0)
ax.NumberFormat = ttl.NumberFormat
ax.HasTitle = True
ax.Title.Caption = ttl.Caption
ax.title.font.size = 8
ax.title.font.color = "#336699"

set ax = cht.Axes(c.chAxisPositionLeft)
ax.Scaling.Orientation = c.chScaleOrientationMaxMin
..plotarea.interior.color = "white"
..axes(1).font.color = "#336699"
..axes(0).font.color = "#336699"
..axes(1).font.size = 7
..axes(0).font.size = 7
..legend.interior.color = "white"
..legend.font.size = 7
..legend.font.color = "#336699"
end with
 
T

Thao Moua [ms]

When binding a Chartspace control to a data source (depending on the data
source) the order of setting the data matters and well as where they are set.
Below are the proper methods to set data to the Chartspace.

* External data
-Series name, category, and value SetData() is called at the Chartspace
level.
-The ordering does not matter.
* Spreadsheet
-For series name and category, SetData() can be called at the Chartspace,
chart, or series level (calling from one level will propagate down to the
rest of the levels.)
-For value, SetData() can only be called at the series level.
-It is recommended to use SetSpreadsheetData() if the data are adjacent
to each other. For non-adjacent data, use SetData().
*Literal data
-For series name and category, SetData() is called at the chart or
series level.
-For value, SetData() is called at the series level.

---------------------------------------
Thao Moua
OWC Chartspace Support

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