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

Multiple data sources for multiple series

1 Answer 490 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Philip
Top achievements
Rank 1
Philip asked on 16 Jul 2014, 08:20 PM
Is it possible to use multiple data sources as multiple series in a chart?

For example
01.var Product1 = [
02.    {"Date": 2012-01-01, "Qty": 2},
03.    {"Date": 2012-02-01, "Qty": 10}
04.]
05.  
06.var Product2 = [
07.    {"Date": 2012-01-01, "Qty": 13},
08.    {"Date": 2012-02-01, "Qty": 17}
09.]


Can I use these two data sources in the same line chart?

1 Answer, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 18 Jul 2014, 11:50 AM
Hello,

The individual series data can be set to arrays of objects, as in your example. Field bindings will still work in this case.
      series: [{
        name: "Product 1",
        data: Product1,
        field: "Qty",
        categoryField: "Date"
      }, {
        name: "Product 2",
        data: Product2,
        field: "Qty",
        categoryField: "Date"
      }]


-- Live demo --

Note that remote binding is not supported in this case. The data needs to be available in advance.

I hope this helps.

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
Philip
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or