Skip to main content

ChartClickEventArgs

Namespace: Wisej.Web.Ext.ChartJS4

Assembly: Wisej.Web.Ext.ChartJS4 (4.1.0.0)

Provides data for the ChartClick event.

public class ChartClickEventArgs : EventArgs

Example:

chart.ChartClick += (s, e) =>
{
foreach (var item in e.Data.data)
e.Chart.Hide((int)item.dataSetIndex, (int)item.pointIndex);
};

Properties​

Instance member Chart​

ChartJS4: Returns the chart that raised the event.

Value: The ChartJS4 control that was clicked.

Example:

chart.ChartClick += (s, e) => e.Chart.UpdateChart();

Instance member 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​

NameDescription
ChartClickEventHandlerRepresents the method that will handle the ChartClick event.