From df211217e238106634bdacae37860fff44c8e787 Mon Sep 17 00:00:00 2001 From: Hamster Date: Sat, 26 Oct 2024 09:28:43 +0800 Subject: [PATCH] Upgrade to LiveCharts 2.0.0-rc4.5. --- ULogViewer/Controls/SessionView.axaml.LogChart.cs | 13 ++++++------- ULogViewer/ULogViewer.csproj | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/ULogViewer/Controls/SessionView.axaml.LogChart.cs b/ULogViewer/Controls/SessionView.axaml.LogChart.cs index 7af49157..2c43b5d4 100644 --- a/ULogViewer/Controls/SessionView.axaml.LogChart.cs +++ b/ULogViewer/Controls/SessionView.axaml.LogChart.cs @@ -39,7 +39,6 @@ using System.Linq; using System.Text; using CarinaStudio.AppSuite.Media; -using System.Collections; using System.Globalization; namespace CarinaStudio.ULogViewer.Controls; @@ -119,7 +118,7 @@ public LvcSize Measure(Chart chart) new Padding(it.Left, it.Top, it.Right, it.Bottom)); foreach (var series in chart.Series.Where(it => it.IsVisible && it.IsVisibleAtLegend)) { - var sketch = series.GetMiniaturesSketch().AsDrawnControl(LogChartLegendZIndex + 1); + var sketch = series.GetMiniature(null, LogChartLegendZIndex + 1); containerChildViews.Add(new StackPanel().Also(it => { it.Children.Add(sketch); @@ -201,7 +200,7 @@ public void Show(IEnumerable foundPoints, Chart)point.Context.Series; - var sketch = series.GetMiniaturesSketch().AsDrawnControl(LogChartToolTipZIndex + 1); + var sketch = series.GetMiniature(null, LogChartToolTipZIndex + 1); if (isFirstPoint) { isFirstPoint = false; @@ -455,7 +454,7 @@ ISeries CreateLogChartSeries(LogChartViewModel viewModel, DisplayableLogChartSer Rx = 0, Ry = 0, Tag = series, - Values = series.Values as ICollection, + Values = series.Values, XToolTipLabelFormatter = chartType == LogChartType.ValueStatisticBars ? null : this.GetLogChartXToolTipLabel, YToolTipLabelFormatter = p => this.GetLogChartYToolTipLabel(series, p, false), }; @@ -488,7 +487,7 @@ ISeries CreateLogChartSeries(LogChartViewModel viewModel, DisplayableLogChartSer IsAntialias = true, }, Tag = series, - Values = series.Values as ICollection, + Values = series.Values, XToolTipLabelFormatter = this.GetLogChartXToolTipLabel, YToolTipLabelFormatter = p => this.GetLogChartYToolTipLabel(series, p, false), }; @@ -504,7 +503,7 @@ ISeries CreateLogChartSeries(LogChartViewModel viewModel, DisplayableLogChartSer Rx = 0, Ry = 0, Tag = series, - Values = series.Values as ICollection, + Values = series.Values, XToolTipLabelFormatter = this.GetLogChartXToolTipLabel, YToolTipLabelFormatter = p => this.GetLogChartYToolTipLabel(series, p, false), }; @@ -561,7 +560,7 @@ or LogChartType.ValueCurvesWithDataPoints }, }, Tag = series, - Values = series.Values as ICollection, + Values = series.Values, XToolTipLabelFormatter = this.GetLogChartXToolTipLabel, YToolTipLabelFormatter = p => this.GetLogChartYToolTipLabel(series, p, false), }; diff --git a/ULogViewer/ULogViewer.csproj b/ULogViewer/ULogViewer.csproj index 6035ddcc..775addcd 100644 --- a/ULogViewer/ULogViewer.csproj +++ b/ULogViewer/ULogViewer.csproj @@ -98,7 +98,7 @@ - +