ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  (polyShape) Object doesn't support this property or method
Posted by andrew on Jan-18-2023 01:05
Hello,

I am new to chartDirector, and I am trying to create a shape but I am getting the following error on the last line :

Object doesn't support this property or method.

var cd = new ActiveXObject("ChartDirector.API");
var c = cd.XYChart(620, 365, 0xffffff, 0xffffff, 0);
c.setPlotArea(60, 35, 500, 250, 0xffffff, -1, cd.Transparent, 0xc0c0c0, -1);
var checkShapeArray = [0, 0, 250, 1000, 240, 1000, 0, 10, -500, 500, -500, 490];
var checkShape = c.getDrawArea();
checkShape.polyShape(JSArrayToDoubleArray(checkShapeArray), 0xff4e4e, 0xc0c0c0);

Is there something obviously wrong my code ?

Thanks in advance,
Andrew

  Re: (polyShape) Object doesn't support this property or method
Posted by Peter Kwan on Jan-18-2023 03:01
Hi Andrew,

DrawArea.polyShape is a new API introduced in the latest version of ChartDirector (version 7). Please make sure you are using the latest version of ChartDirector.

Note that we no longer provided JScript sample code in ChartDirector 7, but ChartDirector 7 is backwards compatible and it can still run JScript programs.

The code in your message seems to be from a very old version of ChartDirector. With recent versions of ChartDirector, the JSArrayToDoubleArray should not be necessary.

For your case, I have just tried your code without the JSArrayToDoubleArray, and it works in my computer:

var cd = new ActiveXObject("ChartDirector.API");
var c = cd.XYChart(620, 365, 0xffffff, 0xffffff, 0);
c.setPlotArea(60, 35, 500, 250, 0xffffff, -1, cd.Transparent, 0xc0c0c0, -1);
var checkShapeArray = [0, 0, 250, 1000, 240, 1000, 0, 10, -500, 500, -500, 490];
var checkShape = c.getDrawArea();
checkShape.polyShape(checkShapeArray, 0xff4e4e, 0xc0c0c0);

Best Regards
Peter Kwan

  Re: (polyShape) Object doesn't support this property or method
Posted by andrew on Jan-18-2023 22:43
Thank you Peter. I will look into finding out about the license key.