Hi i work for PRO IT, Brazil, and i'm trying to use the method
objChart.SetData in OWC10 (I did it in OWC9) but i'm having som problems.
The following code was written using vbscript on a client script.
I'm using
VB.NET(VS 2003)
sub ChartBind()
Dim cht 'reference to my chart
Dim c 'reference to ChartSpace constants
Dim ctr
document.all.ChartDiv.innerHTML = "<CENTER><OBJECT name='WebChart' id='WebChart' height='75%' width='100%' classid='CLSID:0002E556-0000-0000-C000-000000000046'><PARAM NAME='XMLData' VALUE=''></OBJECT></CENTER>"
myForm.WebChart.Clear
Set myForm.WebChart.DataSource = myForm.myPivotTable
myForm.WebChart.PlotAllAggregates = myForm.WebChart.Constants.chPlotAggregatesSeries
set cht = myForm.WebChart.Charts(0) 'I already have a chart
Set c = myForm.WebChart.Constants
cht.Type = 6
cht.HasLegend = False
cht.HasTitle = True
cht.Title.Caption = myForm.PivotTable.ActiveView.TitleBar.Caption
If chkBoxInvertSerie Then 'Invert selection
cht.SetData c.chDimSeriesNames, 0, c.chPivotColumns
cht.SetData c.chDimCategories, 0, c.chPivotRows
Else 'Do not invert it
cht.SetData c.chDimSeriesNames, 0, c.chPivotRows
cht.SetData c.chDimCategories, 0, c.chPivotColumns
End If
cht.SetData c.chDimValues, 0, 0
end sub
'I've tried to use c.chPivotColAggregates and c.chPivotRowAggregates
'but it didn't work either
When i run my project a error occurs in the first SetData
-> cht.SetData c.chDimSeriesNames, 0, c.chPivotRows
What am i doing wrong???
I need to develop a 2 value-axes scalling chart, where a series can be plotted against its own value axis with scaling that is different from the axis for the others series.
And the chart must be able to show series from PivotTable columns and from rows either. (that's why i used invert)