We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Create a pie chart from a remote datasource

Thread ID:

Created:

Updated:

Platform:

Replies:

120212 Sep 10,2015 04:09 PM Sep 14,2015 07:56 AM JavaScript 3
loading
Tags: ejChart
David Elies
Asked On September 10, 2015 04:09 PM

I have created a dataManager and used it to fill a grid with data.  Now, when I try to change the grid to a pie chart, I cannot get a chart to display.  I can't figure out how to get my json data from the dataManager into the pie chart. I have tried to initialize my pie chart like this:
chart = $("#chart").ejChart({
            title: { text: 'Top Ten Requests' },
            legend: { visible: true },
            series: [{
                type: 'pie',
                dataSource: dataManager,
                type: 'pie',
                xName: "Name",
                yName: "Requests",
                query: query
            }]
        });

The data returned from the datasource looks like this:
[{"Requests":65,"Name":"Alan's Agriculture","ExtraData":"Akron, OH"},{"Requests":14,"Name":"Bob's Borders and Edging","ExtraData":"Juneau, AK"}...]

Sanjith Kesavan [Syncfusion]
Replied On September 11, 2015 09:54 AM

Hi Davis Elies,
We have analyzed your query and replicated the scenario in our sample. But we are not able to reproduce the reported issue. We have prepared the sample based on your requirement. In the sample we have retrieved the data from the nortwnd service. Please find the below code example
Code example
[JS]
  
In the above code we have used a “query” to retrieve the data from the Northwnd service. Using “query”  we took 3 data from the Nortwnd and bind that data to the pie chart. “Query” is must to bind the data to chart using datamanager.


Please find the screenshot of the chart below.

Please find the sample from below mentioned location.
Sample Link: http://www.syncfusion.com/downloads/support/forum/120212/ze/export1425557291
Still you are facing this issue means please let us know by modifying the existing sample along with a replication procedure or send us the code example, that how are trying to retrieve data, with the query you have used in the chart.

Please let us know if you have any concern.

Regards,

Sanjith K.​


David Elies
Replied On September 11, 2015 11:36 AM

I'm sorry, I was using a custom OData4Adaptor in order to fix a different problem, and the response wasn't being properly formatted.  I got it working now.  I will post another question about how to get the excel and PDF exports working.

Sanjith Kesavan [Syncfusion]
Replied On September 14, 2015 07:56 AM

Hi David Elies,
Thanks for the update.
Regards,
Sanjith K.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;