Update OxyPlot

Closes #569
Closes #570
This commit is contained in:
PhyxionNL
2022-02-07 17:50:38 +01:00
parent ca615c952f
commit 0cedefd246
2 changed files with 23 additions and 17 deletions
@@ -23,8 +23,8 @@
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="TaskScheduler" Version="2.10.0" />
<PackageReference Include="OxyPlot.Core" Version="2.0.0" />
<PackageReference Include="OxyPlot.WindowsForms" Version="2.0.0" />
<PackageReference Include="OxyPlot.Core" Version="2.1.0" />
<PackageReference Include="OxyPlot.WindowsForms" Version="2.1.0" />
<PackageReference Include="System.Management" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
+21 -15
View File
@@ -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);
}
}
}