From 0cedefd246169415892edd5a936a062aa91db6bf Mon Sep 17 00:00:00 2001
From: PhyxionNL <7643972+PhyxionNL@users.noreply.github.com>
Date: Mon, 7 Feb 2022 17:50:38 +0100
Subject: [PATCH] Update OxyPlot
Closes #569
Closes #570
---
.../LibreHardwareMonitor.csproj | 4 +--
LibreHardwareMonitor/UI/ScaledPlotModel.cs | 36 +++++++++++--------
2 files changed, 23 insertions(+), 17 deletions(-)
diff --git a/LibreHardwareMonitor/LibreHardwareMonitor.csproj b/LibreHardwareMonitor/LibreHardwareMonitor.csproj
index 74c3a08..b680dbe 100644
--- a/LibreHardwareMonitor/LibreHardwareMonitor.csproj
+++ b/LibreHardwareMonitor/LibreHardwareMonitor.csproj
@@ -23,8 +23,8 @@
-
-
+
+
diff --git a/LibreHardwareMonitor/UI/ScaledPlotModel.cs b/LibreHardwareMonitor/UI/ScaledPlotModel.cs
index 2e6aec9..39352be 100644
--- a/LibreHardwareMonitor/UI/ScaledPlotModel.cs
+++ b/LibreHardwareMonitor/UI/ScaledPlotModel.cs
@@ -1,28 +1,34 @@
using OxyPlot;
+using OxyPlot.Legends;
namespace LibreHardwareMonitor.UI
{
class ScaledPlotModel : PlotModel
{
- public ScaledPlotModel(double dpiXscale, double dpiYscale) : base()
+ public ScaledPlotModel(double dpiXscale, double dpiYscale)
{
PlotMargins = new OxyThickness(PlotMargins.Left * dpiXscale,
- PlotMargins.Top * dpiYscale,
- PlotMargins.Right * dpiXscale,
- PlotMargins.Bottom * dpiYscale
- );
+ PlotMargins.Top * dpiYscale,
+ PlotMargins.Right * dpiXscale,
+ PlotMargins.Bottom * dpiYscale);
+
Padding = new OxyThickness(Padding.Left * dpiXscale,
- Padding.Top * dpiYscale,
- Padding.Right * dpiXscale,
- Padding.Bottom * dpiYscale
- );
+ Padding.Top * dpiYscale,
+ Padding.Right * dpiXscale,
+ Padding.Bottom * dpiYscale);
+
TitlePadding *= dpiXscale;
- LegendSymbolLength *= dpiXscale;
- LegendSymbolMargin *= dpiXscale;
- LegendPadding *= dpiXscale;
- LegendColumnSpacing *= dpiXscale;
- LegendItemSpacing *= dpiXscale;
- LegendMargin *= dpiXscale;
+
+ Legend legend = new();
+
+ legend.LegendSymbolLength *= dpiXscale;
+ legend.LegendSymbolMargin *= dpiXscale;
+ legend.LegendPadding *= dpiXscale;
+ legend.LegendColumnSpacing *= dpiXscale;
+ legend.LegendItemSpacing *= dpiXscale;
+ legend.LegendMargin *= dpiXscale;
+
+ Legends.Add(legend);
}
}
}