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

Populate pie chart from a Radgrid column

3 Answers 250 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Kunal
Top achievements
Rank 1
Kunal asked on 01 Feb 2018, 12:52 PM

Hi All, i'm working on producing a dynamic pie chart that's linked to a Radgrid column and updates as the grid is being filtered  . 

 

I have a Radgrid with the following columns; 

application ids'

Application Status (only 3 status's "accepted/declined/in-progress")

Received date from

Revived date to 

BatchID

 

What i'm trying to achieve;

1) Piechart that's based on the application status column 

2) The Pie chart to recalculate when the applications are being filtered by Received date or batchID

 

Any advise or solutions will be much appreciated.

3 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 01 Feb 2018, 12:57 PM

Hi Kunal,

Here is a similar example: https://demos.telerik.com/aspnet-ajax/htmlchart/examples/applicationscenarios/htmlchartingridcolumn/defaultcs.aspx?product=htmlchart.

Regards,

Marin Bratanov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Kunal
Top achievements
Rank 1
answered on 25 Feb 2018, 08:10 AM

Hi Marin, 

My previous explanation wasn't clear enough; 

 

Example Radgrid data

AppID | AppStatus | FromDate | ToDate 

1 | In-Progress | 01012017 | 02022017

2 | Accepted | 01012017 | 02022017

3 | Declined | 03012017 | 04022017

4 | Declined | 03012017 | 04022017

5 | Accepted | 03012017 | 04022017

 

I need a piechart to be displayed outside the radgrid. it also needs to find all the unique values in the AppStatus column and show the total occourance of each Status.

 

With the example data i need the piechart to show 

inprogress =1

declined = 2

accepted = 2

 

the next part would be to have the pie chart update every time i filter the data.

for example if i filter between 03012017 - 04022017  the pie chart should show;

 

in-progress = 0

declined = 2

accepted = 1

 

0
Marin Bratanov
Telerik team
answered on 04 May 2018, 01:35 PM
Hi,
I have answered your support ticket with this question and I am pasting the same guidance here as well, in case someone has such a question in the future.

The chart needs a data source with the appropriate data, so as soon as you provide that, it can display the data. This means that you would need to aggregate the original data into the desired format. You may find useful the following article on data binding a chart and the data format it needs: https://docs.telerik.com/devtools/aspnet-ajax/controls/htmlchart/data-binding/overview.

To get what the user filters in the grid, you can use the ItemCommand of the grid: https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/how-to/Filtering/operate-with-the-filterexpression-manually. This will allow you to filter the data source you have in order to then aggregate it for the chart.


Regards,
Marin Bratanov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Chart (HTML5)
Asked by
Kunal
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Kunal
Top achievements
Rank 1
Share this question
or