From fe5cd0a2f0c02878af32c80655d1bd3f3b6a2107 Mon Sep 17 00:00:00 2001 From: Matthew Strasiotto <39424834+matthewstrasiotto@users.noreply.github.com> Date: Sat, 1 May 2021 20:09:43 +1000 Subject: Implement ChartXY.SetStreaming, sets colours, colors not set in setup --- grapher/Models/Charts/ChartXY.cs | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs index 237538f..d2247cb 100644 --- a/grapher/Models/Charts/ChartXY.cs +++ b/grapher/Models/Charts/ChartXY.cs @@ -89,10 +89,10 @@ namespace grapher #region Methods - public static void setChartColors(Chart chart) + public static void setChartColors(Chart chart, System.Drawing.Color fgColor, System.Drawing.Color bgColor) { - System.Drawing.Color fgColor = global::grapher.Properties.Settings.Default.Chart_FG_Colour; - System.Drawing.Color bgColor = global::grapher.Properties.Settings.Default.Chart_BG_Colour; + // System.Drawing.Color fgColor = global::grapher.Properties.Settings.Default.Chart_FG_Colour; + // System.Drawing.Color bgColor = global::grapher.Properties.Settings.Default.Chart_BG_Colour; System.Drawing.Color bgTrans = System.Drawing.Color.Transparent; chart.ForeColor = fgColor; @@ -176,8 +176,6 @@ namespace grapher ElementPosition legendPosNew = new ElementPosition(75, 0, 25, 25); legend.Position = legendPosNew; - - setChartColors(chart); } public static void DrawPoint(Chart chart, PointData pointOne, PointData pointTwo = null) @@ -374,6 +372,22 @@ namespace grapher ChartY.Height = height; } + public void SetStreaming(bool streaming) + { + var fgColor = Constants.fgNoStreamer; + var bgColor = Constants.bgNoStreamer; + + if (streaming) + { + fgColor = Constants.fgStreamer; + bgColor = Constants.bgStreamer; + } + + setChartColors(ChartX, fgColor, bgColor); + setChartColors(ChartY, fgColor, bgColor); + Update(); + } + private string SetComponentTitle(string component) { return $"{Title} : {component}"; -- cgit v1.2.3