Hi Davide,
Greetings from Syncfusion. We have analyzed your query. As of now, we are not having built-in support for selection and so we have achieved your requirement by using “ChartRegionClick” event as per the below code.
[C#]
|
Color SelectionColor = Color.OrangeRed;
Color SeriesColor = Color.SeaGreen;
public Form1()
{
chart.ChartRegionClick += Chart_ChartRegionClick;
}
private void Chart_ChartRegionClick(object sender, ChartRegionMouseEventArgs e)
{
double X = Math.Round(chart.ChartArea.GetValueByPoint(e.Point).X);
for(int i = 0; i < series.Points.Count; i++)
{
if (i == X)
{
series.Styles[i].Interior = new Syncfusion.Drawing.BrushInfo(SelectionColor);
}
else
{
series.Styles[i].Interior = new Syncfusion.Drawing.BrushInfo(SeriesColor);
}
}
chart.Refresh();
} |
In the above code, we have set the value of the clicked point, using “GetValueByPoint” method and set the different color (OrangeRed) for that particular point and redrawn the chart. Please find the below output while rendering the chart.
Output for before selection.
Output for after selection.
We have prepared a sample based on this, please find the sample from the following location.
We have already logged feature request on this. Based on its priority and complexity this feature will be included in any out upcoming release.
Please let us know if you have any queries.
Thanks,
Muneesh Kumar G