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

Multiple Datasources for a Single Chart?

1 Answer 436 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Jayme
Top achievements
Rank 1
Jayme asked on 18 Feb 2016, 03:41 AM

Is it possible to use 2 datasources with a single bar chart? I am trying to create a bar chart that would show gift card orders and redemption over time in the same chart.  I have 2 datasources, orders and redemptions.  (These are OData returning json to a kendo datasource).  

I was hoping I could do something in the chart like:
 series: [
            {
                name: "Purchased",
                data:dsOrders,
                field: "Amount",
                aggregate: "sum",
                categoryField: "PurchaseDate",
            },
        {
            name: "Redeemed",
            data:dsRedemptions,
            field: "RedeemedAmount",
            aggregate: "sum",
            categoryField: "RedeemedDate"
        }
        ],

 

Trying that directly didn't work so I was wondering if there is something I am missing?  Thanks so much,

Jayme

1 Answer, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 22 Feb 2016, 08:01 AM
Hi Jayme,

Apologies for the delayed reply.

Kendo UI Chart can be only bound to a single data source - you will need to join the data from multiple data sources in order to display it in the chart.

On a side note, the individual series data can be bound to separate arrays of data. For more details as well as an example check the following forum thread:
http://www.telerik.com/forums/multiple-data-sources-for-multiple-series#_8QY12Oe2kePRTXizDabJA

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