Hi Francesco,
Thanks for contacting Syncfusion Support.
In default, SfChart has support for dragging the ColumnSeries and it can be achieved by enabling the EnableSegmentDragging property of ColumnSeries as shown in the below code snippet,
<chart:ColumnSeries EnableSegmentDragging="True"
EnableDragTooltip="False" /> |
We are able to change the color of column segment while dragging with MouseLeftButtonDown and MouseLeftButtonUp events of column series. Please find the code snippet,
Model selectedModel;
private void ColumnSeries_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
var column = sender as ColumnSeries;
if (e.OriginalSource is Rectangle)
{
selectedModel = ((e.OriginalSource as Rectangle).Tag as
ColumnSegment).Item as Model;
column.SelectedIndex = (column.ItemsSource as
ObservableCollection<Model>).IndexOf(selectedModel);
}
}
private void ColumnSeries_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
(sender as ColumnSeries).SelectedIndex = -1;
} |
Please find the output screenshot,
We have prepared a demo sample for your reference and it can be downloaded from below link,
Kindly refer our UG documentation link to know more about the data editing in chart series,
Regards,
Devi