We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm working on a chart with point selection. With ScatterSeries and ChartPointPointerDown some points change the color when hovering over.
ChartPointPointerDown
Reproduce
public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); Series[0] = S; S.ChartPointPointerDown += S_ChartPointPointerDown; DataContext = this; } private LiveChartsCore.Kernel.ChartPoint<ObservablePoint, LiveChartsCore.SkiaSharpView.Drawing.Geometries.CircleGeometry, LiveChartsCore.SkiaSharpView.Drawing.Geometries.LabelGeometry>? lastPoint = null; private void S_ChartPointPointerDown(LiveChartsCore.Kernel.Sketches.IChartView chart, LiveChartsCore.Kernel.ChartPoint<ObservablePoint, LiveChartsCore.SkiaSharpView.Drawing.Geometries.CircleGeometry, LiveChartsCore.SkiaSharpView.Drawing.Geometries.LabelGeometry>? point) { if(lastPoint?.Visual != null) { lastPoint.Visual.Fill = new SolidColorPaint(SKColors.Blue); } if(point?.Visual != null) { point.Visual.Fill = new SolidColorPaint(SKColors.Red); } lastPoint = point; } public ISeries[] Series { get; set; } = new ISeries[1]; ScatterSeries<ObservablePoint> S { get; set; } = new ScatterSeries<ObservablePoint> { Values = new ObservableCollection<ObservablePoint> { new(2.2, 5.4), new(4.5, 2.5), new(4.2, 7.4), new(6.4, 9.9), new(4.2, 9.2), new(5.8, 3.5), new(7.3, 5.8), new(8.9, 3.9), new(6.1, 4.6), new(9.4, 7.7), new(8.4, 8.5), new(3.6, 9.6), new(4.4, 6.3), new(5.8, 4.8), new(6.9, 3.4), new(7.6, 1.8), new(8.3, 8.3), new(9.9, 5.2), new(8.1, 4.7), new(7.4, 3.9), new(6.8, 2.3), new(5.3, 7.1), } }; }
Screenshots
The text was updated successfully, but these errors were encountered:
Visuals do not implement INotifyPropertyChanged, that is by design, it means that the UI will not update automatically,
INotifyPropertyChanged
Have you tried to call a chart update? like shown here https://livecharts.dev/docs/Maui/2.0.0-beta.920/samples.events.cartesian
chart.Invalidate();
Sorry, something went wrong.
Same problem when using chart.Invalidate();
private void S_ChartPointPointerDown(LiveChartsCore.Kernel.Sketches.IChartView chart, LiveChartsCore.Kernel.ChartPoint<ObservablePoint, LiveChartsCore.SkiaSharpView.Drawing.Geometries.CircleGeometry, LiveChartsCore.SkiaSharpView.Drawing.Geometries.LabelGeometry>? point) { if (point?.Visual == null) return; if(lastPoint?.Visual != null) { lastPoint.Visual.Fill = null; } point.Visual.Fill = new SolidColorPaint(SKColors.Red); chart.Invalidate(); lastPoint = point; }
298983d
No branches or pull requests
I'm working on a chart with point selection. With ScatterSeries and
ChartPointPointerDown
somepoints change the color when hovering over.
Reproduce
Screenshots
2023-08-22.13-39-33.mp4
The text was updated successfully, but these errors were encountered: