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

how to create a function that starts at the click event of the pie chart?

1 Answer 309 Views
Charts
This is a migrated thread and some comments may be shown as answers.
alex
Top achievements
Rank 1
Iron
Veteran
alex asked on 18 Nov 2020, 02:16 PM

Hi,

how to create a function that starts at the click event of the pie chart?

i would to pass the selected item to a function

 

                                     <kendo-chart-series>
                              <kendo-chart-series-item
                                type="pie" [data]="dataSourcePieChart"
                                categoryField="cost" field="cost">
                                    <kendo-chart-series-item-labels
                                        position="outsideEnd"
                                        color="#000"
                                        [content]="labelContent">
                                    </kendo-chart-series-item-labels>
                                </kendo-chart-series-item>
                            </kendo-chart-series>

 

Alex

1 Answer, 1 is accepted

Sort by
0
Hetali
Telerik team
answered on 19 Nov 2020, 09:44 PM

Hello Alex,

The Kendo UI Chart has a built-in event that starts a function when you click on the series. The SeriesClickEvent also passes a list of arguments in the function. For example:

<kendo-chart (seriesClick)="seriesClick($event)">
  <kendo-chart-series>
    <kendo-chart-series-item type="pie">
    </kendo-chart-series-item>
  </kendo-chart-series>
</kendo-chart>

seriesClick(e) {
  console.log(e);
  alert("Value: " + e.dataItem.value);
}

In this StackBlitz example, the Kendo UI Pie Chart has a SerisClickEvent function.

Please let me know if this helps or if you have any further questions pertaining to this case.

Regards,
Hetali
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Charts
Asked by
alex
Top achievements
Rank 1
Iron
Veteran
Answers by
Hetali
Telerik team
Share this question
or