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

Kendo mobile line chart binding not working

1 Answer 28 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nirav
Top achievements
Rank 1
Nirav asked on 29 Aug 2014, 07:08 PM
Hello,

I want to create a line chart and bind the data using JSON file. This is my code but it is not working. 

 $("#line-chart1").kendoChart({
                theme: $(document).data("kendoSkin") || "BlueOpal",
                legend: {
                    visible: false
                },
                dataSource: {
                    transport: {
                        read: {
                            url: "Myjsonfile",
                            dataType: "json"
                        }
                    }
                },
                seriesDefaults: {
                    type: "Line"
                },
                series: [{
                    currentField: "current",
                    targetField: "target"
                }],
                valueAxis: {
                    majorUnit: 8000
                },
                tooltip: {
                    visible: true,
                    shared: true,
                    format: "N0"
                }
            });

This is my json file 

[{
    "current": 800,
    "target": 200
}]



Thanks.

1 Answer, 1 is accepted

Sort by
0
Iliana Nikolova
Telerik team
answered on 01 Sep 2014, 03:03 PM
Hello Nirav,

For categorical charts (such as line, column etc.) you should define series.field (not currentField / targetField). For example: 
//....
series: [{
   type: "line",
   field: "current"
}],
For working example check the online demos.

Regards,
Iliana Nikolova
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
General Discussions
Asked by
Nirav
Top achievements
Rank 1
Answers by
Iliana Nikolova
Telerik team
Share this question
or