Changing chart type from JavaScript

B

brian_madden

Hi,
I have a chart control that I am binding to a pivot table in javascript. The
pivot table is pulling data from an OLAP data source. I am trying to change
the chart type from the default bar chart to one of the other types but it is
not working. I have a code snippet below showing what I am doing.

var consts;
consts = form1.Chart1.Constants;
form1.Chart1.Type = consts.chChartTypeColumn3D;
form1.PivotTable1.XMLData = results.value;
form1.Chart1.Clear();
form1.Chart1.DataSource = form1.PivotTable1;

Can someone help me with this?

Thanks!
Brian
 
B

brian_madden

Found the problem.
Should be form1.Chart1.Charts(0).Type = consts.chChartTypeColumn3D;
instead of
form1.Chart1.Type = consts.chChartTypeColumn3D;
 

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