This is a migrated thread and some comments may be shown as answers.

Error when using sample code with typescript

1 Answer 78 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Andre
Top achievements
Rank 1
Andre asked on 17 Jul 2014, 10:02 PM
Hi,

I'm getting an error when initializing a chart control using typescript, the category and value axis properties cause the error:

Specifically: 

Supplied parameters do not match any signature of call target:
Types of property 'categoryAxis' of types '{ title: { text: string; }; legend: { visible: boolean; }; series: kendo.dataviz.ui.ChartSeriesItem[]; categoryAxis: { title: { text: string; }; majorGridLines: { visible: boolean; }; majorTicks: { visible: boolean; }; [n: number]: kendo.dataviz.ui.ChartCategoryAxisItem; }; valueAxis: { max: number; title: { text: string; }; majorGridLines: { visible: boolean; }; visible: boolean; [n: number]: kendo.dataviz.ui.ChartValueAxisItem; }; }' and 'kendo.dataviz.ui.ChartOptions' are incompatible:
Type '{ title: { text: string; }; majorGridLines: { visible: boolean; }; majorTicks: { visible: boolean; }; [n: number]: kendo.dataviz.ui.ChartCategoryAxisItem; }' is missing property 'concat' from type 'kendo.dataviz.ui.ChartCategoryAxisItem[]'.

The interesting thing is that none of the other widgets I have used with typescript so far: grid, tabstrip, and map have had this issue. And I'm literally copying and pasting the json into the options object. How would I go about solving this problem?

Thanks!

Andre

1 Answer, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 18 Jul 2014, 02:40 PM
Hello,

This problem seems to be caused by the axis definitions for the chart. They can be both objects and array of objects and this seems to throw our generation off.
We'll investigate further and try to determine if a solution is possible.

Please, try wrapping the axis definitions in an array:
valueAxis: [{
  ...
}],
categoryAxis: [{
  ...
}]


Apologies for the caused inconvenience.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Charts
Asked by
Andre
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or