ChartClickEventArgs
Namespace: Wisej.Web.Ext.ChartJS4
Assembly: Wisej.Web.Ext.ChartJS4 (4.1.0.0)
Provides data for the ChartClick event.
- C#
- VB.NET
public class ChartClickEventArgs : EventArgs
Public Class ChartClickEventArgs
Inherits EventArgs
Example:
chart.ChartClick += (s, e) =>
{
foreach (var item in e.Data.data)
e.Chart.Hide((int)item.dataSetIndex, (int)item.pointIndex);
};
Properties
Chart
ChartJS4: Returns the chart that raised the event.
Value: The ChartJS4 control that was clicked.
Example:
chart.ChartClick += (s, e) => e.Chart.UpdateChart();
Data
Object: Returns the event data sent by the client.
Value: A dynamic object with a data array containing one entry for each chart element under the pointer. Each entry has the pointIndex (index of the data point) and dataSetIndex (index of the dataset) fields.
Example:
chart.ChartClick += (s, e) =>
{
int dataSetIndex = e.Data.data[0].dataSetIndex;
int pointIndex = e.Data.data[0].pointIndex;
var value = e.Chart.DataSets[dataSetIndex].Data[pointIndex];
};
Used By
| Name | Description |
|---|---|
| ChartClickEventHandler | Represents the method that will handle the ChartClick event. |