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

How to draw a chart which has one scatter chart series and one scatter line chart series from remote data?

1 Answer 30 Views
Charts
This is a migrated thread and some comments may be shown as answers.
bandariiswear
Top achievements
Rank 1
bandariiswear asked on 21 Jan 2014, 03:49 PM

I want to draw a chart has one scatter series and one scatter line
series from remote json data,For example,I define the model like this:

public class Point{
public double XPoint{get;set;}
public double YPoint{get;set;}
}
public class ChartDataSource{
//the datasource to draw a line
public List<Point> LineSeriesDataSource{get;set;}
//the datasource to draw some points
public List<Point> PointSeriesDataSource{get;set;}
//the chart title
public string ChartTitle{get;set;}
}


In the view,How to show the chart?I write like this,but it do not work.
//use ajax to get datasource
var datasource=GetDataSource();
$("#samplechart").kendoChart({
title: { text: dataSource.ChartTitle},
dataSource:dataSource,
series: [{
type: "ScatterLine",
field: "LineSeriesDataSource.YPoint"
//groupNameTemplate: "Line Temple "
},
{
type: "Scatter",
field: "PointSeriesDataSource.YPoint"
//groupNameTemplate: "Scatter Temple"
}],
legend: {
position: "bottom"
},

categoryAxis: {
field: "XPoint",
majorGridLines: {
visible: false
}},
tooltip: {
visible: true,
template: "#= series.name # : #= value #"
},
autoBind: true
});

1 Answer, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 23 Jan 2014, 08:07 AM
Hi Bandariiswear,

We have an example which demonstrates how to bind Kendo UI Scatter Chart to a remote dataSource. Note that the online demos demonstrate only the HTML/JavaScript framework and the views - for the full source (controllers, models etc.) check the offline demos from the distribution package. 

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
Charts
Asked by
bandariiswear
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Share this question
or