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. Image for the cookie policy date

Change values in function grid rows selected

Hi,

I want to show a chart that its values changes dinamically in function the rows selected in a grid

For example

In this grid



I like a similar chart



But when the user, select a new grid row, the chart update its values.

How can I do it?

Thanks a lot

3 Replies

VA Vinothkumar Arumugam Syncfusion Team August 7, 2015 12:53 PM UTC

Hi Manolo,
We have analyzed your query, we have prepared workaround sample based on your requirements.
We have created simple CountriesSalesData data model. This is used for grid data Source.  We are also loading these data for chart. Initially chart loaded default data from source after you can give the selected grid data source based on your requirements.
You can get selected record by enable SelectionType as Multiple and using RowSelecting event. And also you can get multiple selected records by using the method called this.getSelectedRecords();
We have summarized data getting from above method. You can summarize any format based on you requirements.
Please find the following code snippet to achieve your requirements.
Code Snippet [MVC]:

·         Below code shows how to use Selection type and RowSelecting event as follows.


·         Summarize the record as follows.


·         Bind the data source to chart as follows.


Below screenshot illustrate this.

·         First time chart load as default data source from source


·         After I am selecting two fields from the grid. Then chart render by using Selection dataSource as

follows.


Please find the below Sample link to download the sample.
Sample Link:
Sample

Please let us know if you have any concern.
Thanks,
Vinothkumar Arumugam.



MA Manolo August 10, 2015 06:57 AM UTC

waw!!

Thank you very much!


VA Vinothkumar Arumugam Syncfusion Team August 11, 2015 10:37 AM UTC

Hi Manolo,
Thanks for the update.
Please let us know if you have any further query on this.
Thanks,
Vinothkumar Arumugam.
 

Loader.
Up arrow icon