From 3f64de9a3643a7e4f32f5442aaf8717b414e763d Mon Sep 17 00:00:00 2001 From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com> Date: Wed, 18 Feb 2026 21:18:07 -0500 Subject: [PATCH] Remove HideGrid() from all Dashboard charts so grid lines are visible Every Dashboard chart called Plot.HideGrid() after ApplyDarkModeToChart(), which set the grid color but then immediately hid the grid. This made grid lines invisible regardless of alpha value. Removing all 50 HideGrid() calls lets the themed grid lines show through, matching Lite's appearance. Partial fix for #110 Co-Authored-By: Claude Opus 4.6 --- Dashboard/Controls/MemoryContent.xaml.cs | 5 ----- .../Controls/QueryPerformanceContent.xaml.cs | 2 -- .../Controls/ResourceMetricsContent.xaml.cs | 12 ------------ Dashboard/Controls/SystemEventsContent.xaml.cs | 18 ------------------ Dashboard/ServerTab.xaml.cs | 13 ------------- 5 files changed, 50 deletions(-) diff --git a/Dashboard/Controls/MemoryContent.xaml.cs b/Dashboard/Controls/MemoryContent.xaml.cs index 90399ecb..2ce4ee10 100644 --- a/Dashboard/Controls/MemoryContent.xaml.cs +++ b/Dashboard/Controls/MemoryContent.xaml.cs @@ -268,7 +268,6 @@ private void LoadMemoryStatsOverviewChart(List memoryData, int MemoryStatsOverviewChart.Plot.Axes.DateTimeTicksBottom(); MemoryStatsOverviewChart.Plot.Axes.SetLimitsX(xMin, xMax); MemoryStatsOverviewChart.Plot.YLabel("MB"); - MemoryStatsOverviewChart.Plot.HideGrid(); // Fixed negative space for legend MemoryStatsOverviewChart.Plot.Axes.AutoScaleY(); var memOverviewLimits = MemoryStatsOverviewChart.Plot.Axes.GetLimits(); @@ -476,7 +475,6 @@ private void LoadMemoryGrantsChart(IEnumerable data, int h MemoryGrantsChart.Plot.Axes.DateTimeTicksBottom(); MemoryGrantsChart.Plot.Axes.SetLimitsX(xMin, xMax); MemoryGrantsChart.Plot.YLabel("MB"); - MemoryGrantsChart.Plot.HideGrid(); // Fixed negative space for legend MemoryGrantsChart.Plot.Axes.AutoScaleY(); var grantsLimits = MemoryGrantsChart.Plot.Axes.GetLimits(); @@ -587,7 +585,6 @@ private void LoadMemoryClerksChart(List data, int hoursBack, D MemoryClerksChart.Plot.Axes.DateTimeTicksBottom(); MemoryClerksChart.Plot.Axes.SetLimitsX(xMin, xMax); MemoryClerksChart.Plot.YLabel("MB"); - MemoryClerksChart.Plot.HideGrid(); // Fixed negative space for legend MemoryClerksChart.Plot.Axes.AutoScaleY(); var clerksLimits = MemoryClerksChart.Plot.Axes.GetLimits(); @@ -737,7 +734,6 @@ private void LoadPlanCacheChart(IEnumerable data, int hoursB PlanCacheChart.Plot.Axes.DateTimeTicksBottom(); PlanCacheChart.Plot.Axes.SetLimitsX(xMin, xMax); PlanCacheChart.Plot.YLabel("MB"); - PlanCacheChart.Plot.HideGrid(); // Fixed negative space for legend PlanCacheChart.Plot.Axes.AutoScaleY(); var planCacheLimits = PlanCacheChart.Plot.Axes.GetLimits(); @@ -857,7 +853,6 @@ private void LoadMemoryPressureEventsChart(IEnumerable MemoryPressureEventsChart.Plot.Axes.DateTimeTicksBottom(); MemoryPressureEventsChart.Plot.Axes.SetLimitsX(xMin, xMax); MemoryPressureEventsChart.Plot.YLabel("Event Count"); - MemoryPressureEventsChart.Plot.HideGrid(); // Fixed negative space for legend MemoryPressureEventsChart.Plot.Axes.AutoScaleY(); var pressureLimits = MemoryPressureEventsChart.Plot.Axes.GetLimits(); diff --git a/Dashboard/Controls/QueryPerformanceContent.xaml.cs b/Dashboard/Controls/QueryPerformanceContent.xaml.cs index cf0ce161..7cefe544 100644 --- a/Dashboard/Controls/QueryPerformanceContent.xaml.cs +++ b/Dashboard/Controls/QueryPerformanceContent.xaml.cs @@ -971,7 +971,6 @@ private void LoadDurationChart(WpfPlot chart, IEnumerable tre chart.Plot.Axes.DateTimeTicksBottom(); chart.Plot.Axes.SetLimitsX(xMin, xMax); chart.Plot.YLabel("Duration (ms/sec)"); - chart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(chart); chart.Refresh(); } @@ -1027,7 +1026,6 @@ private void LoadExecChart(IEnumerable execTrends, int hours QueryPerfTrendsExecChart.Plot.Axes.DateTimeTicksBottom(); QueryPerfTrendsExecChart.Plot.Axes.SetLimitsX(xMin, xMax); QueryPerfTrendsExecChart.Plot.YLabel("Executions/sec"); - QueryPerfTrendsExecChart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(QueryPerfTrendsExecChart); QueryPerfTrendsExecChart.Refresh(); } diff --git a/Dashboard/Controls/ResourceMetricsContent.xaml.cs b/Dashboard/Controls/ResourceMetricsContent.xaml.cs index 08e9bcde..119fcdc1 100644 --- a/Dashboard/Controls/ResourceMetricsContent.xaml.cs +++ b/Dashboard/Controls/ResourceMetricsContent.xaml.cs @@ -358,7 +358,6 @@ private void LoadLatchStatsChart(IEnumerable data, int hoursBack LatchStatsChart.Plot.Axes.SetLimitsX(xMin, xMax); TabHelpers.SetChartYLimitsWithLegendPadding(LatchStatsChart); LatchStatsChart.Plot.YLabel("Wait Time (ms/sec)"); - LatchStatsChart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(LatchStatsChart); LatchStatsChart.Refresh(); } @@ -450,7 +449,6 @@ private void LoadSpinlockStatsChart(IEnumerable data, int hou SpinlockStatsChart.Plot.Axes.SetLimitsX(xMin, xMax); TabHelpers.SetChartYLimitsWithLegendPadding(SpinlockStatsChart); SpinlockStatsChart.Plot.YLabel("Collisions/sec"); - SpinlockStatsChart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(SpinlockStatsChart); SpinlockStatsChart.Refresh(); } @@ -559,7 +557,6 @@ private void LoadCombinedTempDbLatencyChart(List da TempDbLatencyChart.Plot.Axes.SetLimitsX(xMin, xMax); TabHelpers.SetChartYLimitsWithLegendPadding(TempDbLatencyChart); TempDbLatencyChart.Plot.YLabel("Latency (ms)"); - TempDbLatencyChart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(TempDbLatencyChart); TempDbLatencyChart.Refresh(); } @@ -665,7 +662,6 @@ private void LoadTempdbStatsChart(IEnumerable data, int hoursBa TempdbStatsChart.Plot.Axes.SetLimitsX(xMin, xMax); TempdbStatsChart.Plot.Axes.AutoScaleY(); TempdbStatsChart.Plot.YLabel("MB"); - TempdbStatsChart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(TempdbStatsChart); TempdbStatsChart.Refresh(); } @@ -837,7 +833,6 @@ private void LoadSessionStatsChart(IEnumerable data, int hours SessionStatsChart.Plot.Axes.SetLimitsX(xMin, xMax); TabHelpers.SetChartYLimitsWithLegendPadding(SessionStatsChart); SessionStatsChart.Plot.YLabel("Session Count"); - SessionStatsChart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(SessionStatsChart); SessionStatsChart.Refresh(); } @@ -951,7 +946,6 @@ private void LoadFileIoChart(ScottPlot.WPF.WpfPlot chart, List cpuData, int hou ServerUtilTrendsCpuChart.Plot.Axes.SetLimitsX(xMin, xMax); TabHelpers.SetChartYLimitsWithLegendPadding(ServerUtilTrendsCpuChart); ServerUtilTrendsCpuChart.Plot.YLabel("CPU %"); - ServerUtilTrendsCpuChart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(ServerUtilTrendsCpuChart); ServerUtilTrendsCpuChart.Refresh(); } @@ -1105,7 +1098,6 @@ private void LoadServerTrendsTempdbChart(IEnumerable tempdbData ServerUtilTrendsTempdbChart.Plot.Axes.SetLimitsX(xMin, xMax); TabHelpers.SetChartYLimitsWithLegendPadding(ServerUtilTrendsTempdbChart); ServerUtilTrendsTempdbChart.Plot.YLabel("MB"); - ServerUtilTrendsTempdbChart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(ServerUtilTrendsTempdbChart); ServerUtilTrendsTempdbChart.Refresh(); } @@ -1211,7 +1203,6 @@ private void LoadServerTrendsMemoryChart(IEnumerable memoryData ServerUtilTrendsMemoryChart.Plot.Axes.SetLimitsX(xMin, xMax); TabHelpers.SetChartYLimitsWithLegendPadding(ServerUtilTrendsMemoryChart); ServerUtilTrendsMemoryChart.Plot.YLabel("MB"); - ServerUtilTrendsMemoryChart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(ServerUtilTrendsMemoryChart); ServerUtilTrendsMemoryChart.Refresh(); } @@ -1287,7 +1278,6 @@ private void LoadServerTrendsPerfmonChart(IEnumerable perfmonD ServerUtilTrendsPerfmonChart.Plot.Axes.SetLimitsX(xMin, xMax); TabHelpers.SetChartYLimitsWithLegendPadding(ServerUtilTrendsPerfmonChart); ServerUtilTrendsPerfmonChart.Plot.YLabel("Per Second"); - ServerUtilTrendsPerfmonChart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(ServerUtilTrendsPerfmonChart); ServerUtilTrendsPerfmonChart.Refresh(); } @@ -1791,7 +1781,6 @@ private void LoadPerfmonCountersChart(List? data, int hoursBac PerfmonCountersChart.Plot.Axes.SetLimitsX(xMin, xMax); TabHelpers.SetChartYLimitsWithLegendPadding(PerfmonCountersChart); PerfmonCountersChart.Plot.YLabel("Value/sec"); - PerfmonCountersChart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(PerfmonCountersChart); PerfmonCountersChart.Refresh(); } @@ -2167,7 +2156,6 @@ private void LoadWaitStatsDetailChart(List? data, int hoursB WaitStatsDetailChart.Plot.Axes.SetLimitsX(xMin, xMax); TabHelpers.SetChartYLimitsWithLegendPadding(WaitStatsDetailChart); WaitStatsDetailChart.Plot.YLabel(useAvgPerWait ? "Avg Wait Time (ms/wait)" : "Wait Time (ms/sec)"); - WaitStatsDetailChart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(WaitStatsDetailChart); WaitStatsDetailChart.Refresh(); } diff --git a/Dashboard/Controls/SystemEventsContent.xaml.cs b/Dashboard/Controls/SystemEventsContent.xaml.cs index 5773c094..e17a5ee6 100644 --- a/Dashboard/Controls/SystemEventsContent.xaml.cs +++ b/Dashboard/Controls/SystemEventsContent.xaml.cs @@ -474,7 +474,6 @@ private void LoadCorruptionEventsCharts(List data, BadPagesChart.Plot.Axes.DateTimeTicksBottom(); BadPagesChart.Plot.Axes.SetLimitsX(xMin, xMax); BadPagesChart.Plot.YLabel("Count"); - BadPagesChart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(BadPagesChart); BadPagesChart.Refresh(); @@ -504,7 +503,6 @@ private void LoadCorruptionEventsCharts(List data, DumpRequestsChart.Plot.Axes.DateTimeTicksBottom(); DumpRequestsChart.Plot.Axes.SetLimitsX(xMin, xMax); DumpRequestsChart.Plot.YLabel("Count"); - DumpRequestsChart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(DumpRequestsChart); DumpRequestsChart.Refresh(); @@ -534,7 +532,6 @@ private void LoadCorruptionEventsCharts(List data, AccessViolationsChart.Plot.Axes.DateTimeTicksBottom(); AccessViolationsChart.Plot.Axes.SetLimitsX(xMin, xMax); AccessViolationsChart.Plot.YLabel("Count"); - AccessViolationsChart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(AccessViolationsChart); AccessViolationsChart.Refresh(); @@ -564,7 +561,6 @@ private void LoadCorruptionEventsCharts(List data, WriteAccessViolationsChart.Plot.Axes.DateTimeTicksBottom(); WriteAccessViolationsChart.Plot.Axes.SetLimitsX(xMin, xMax); WriteAccessViolationsChart.Plot.YLabel("Count"); - WriteAccessViolationsChart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(WriteAccessViolationsChart); WriteAccessViolationsChart.Refresh(); } @@ -606,7 +602,6 @@ private void LoadContentionEventsCharts(List data, NonYieldingTasksChart.Plot.Axes.DateTimeTicksBottom(); NonYieldingTasksChart.Plot.Axes.SetLimitsX(xMin, xMax); NonYieldingTasksChart.Plot.YLabel("Count"); - NonYieldingTasksChart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(NonYieldingTasksChart); NonYieldingTasksChart.Refresh(); @@ -636,7 +631,6 @@ private void LoadContentionEventsCharts(List data, LatchWarningsChart.Plot.Axes.DateTimeTicksBottom(); LatchWarningsChart.Plot.Axes.SetLimitsX(xMin, xMax); LatchWarningsChart.Plot.YLabel("Count"); - LatchWarningsChart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(LatchWarningsChart); LatchWarningsChart.Refresh(); @@ -700,7 +694,6 @@ private void LoadContentionEventsCharts(List data, SickSpinlocksChart.Plot.Axes.DateTimeTicksBottom(); SickSpinlocksChart.Plot.Axes.SetLimitsX(xMin, xMax); SickSpinlocksChart.Plot.YLabel("Backoffs"); - SickSpinlocksChart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(SickSpinlocksChart); SickSpinlocksChart.Refresh(); @@ -752,7 +745,6 @@ private void LoadContentionEventsCharts(List data, CpuComparisonChart.Plot.Axes.SetLimitsX(xMin, xMax); CpuComparisonChart.Plot.Axes.SetLimitsY(0, 100); // Fixed Y-axis for CPU percentage CpuComparisonChart.Plot.YLabel("CPU %"); - CpuComparisonChart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(CpuComparisonChart); CpuComparisonChart.Refresh(); } @@ -853,7 +845,6 @@ private void LoadSevereErrorsChart(IEnumerable data SevereErrorsChart.Plot.Axes.DateTimeTicksBottom(); SevereErrorsChart.Plot.Axes.SetLimitsX(xMin, xMax); SevereErrorsChart.Plot.YLabel("Event Count"); - SevereErrorsChart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(SevereErrorsChart); SevereErrorsChart.Refresh(); } @@ -1013,7 +1004,6 @@ private void LoadIOIssuesChart(IEnumerable data, int ho IOIssuesChart.Plot.Axes.DateTimeTicksBottom(); IOIssuesChart.Plot.Axes.SetLimitsX(xMin, xMax); IOIssuesChart.Plot.YLabel("Count"); - IOIssuesChart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(IOIssuesChart); IOIssuesChart.Refresh(); } @@ -1108,7 +1098,6 @@ private void LoadLongestPendingIOChart(IEnumerable data LongestPendingIOChart.Plot.Axes.DateTimeTicksBottom(); LongestPendingIOChart.Plot.Axes.SetLimitsX(xMin, xMax); LongestPendingIOChart.Plot.YLabel("Duration (ms)"); - LongestPendingIOChart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(LongestPendingIOChart); LongestPendingIOChart.Refresh(); } @@ -1208,7 +1197,6 @@ long ParseNonYield(string? value) SchedulerIssuesChart.Plot.Axes.DateTimeTicksBottom(); SchedulerIssuesChart.Plot.Axes.SetLimitsX(xMin, xMax); SchedulerIssuesChart.Plot.YLabel("Total Non-Yield Time (ms)"); - SchedulerIssuesChart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(SchedulerIssuesChart); SchedulerIssuesChart.Refresh(); } @@ -1359,7 +1347,6 @@ private void LoadMemoryConditionsChart(IEnumerable data, int h CPUTasksChart.Plot.Axes.DateTimeTicksBottom(); CPUTasksChart.Plot.Axes.SetLimitsX(xMin, xMax); CPUTasksChart.Plot.YLabel("Workers"); - CPUTasksChart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(CPUTasksChart); CPUTasksChart.Refresh(); } @@ -1739,7 +1725,6 @@ private void LoadMemoryBrokerChart(IEnumerable dat { chart.Plot.Axes.DateTimeTicksBottom(); chart.Plot.Axes.SetLimitsX(xMin, xMax); - chart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(chart); chart.Refresh(); } @@ -1894,7 +1879,6 @@ private void LoadMemoryNodeOOMChart(IEnumerable d MemoryNodeOOMChart.Plot.Axes.DateTimeTicksBottom(); MemoryNodeOOMChart.Plot.Axes.SetLimitsX(xMin, xMax); MemoryNodeOOMChart.Plot.YLabel("Event Count"); - MemoryNodeOOMChart.Plot.HideGrid(); TabHelpers.LockChartVerticalAxis(MemoryNodeOOMChart); MemoryNodeOOMChart.Refresh(); } @@ -1944,7 +1928,6 @@ private void LoadMemoryNodeOOMUtilChart(IEnumerable data, int h BlockingStatsBlockingEventsChart.Plot.Axes.DateTimeTicksBottom(); BlockingStatsBlockingEventsChart.Plot.Axes.SetLimitsX(xMin, xMax); BlockingStatsBlockingEventsChart.Plot.YLabel("Count"); - BlockingStatsBlockingEventsChart.Plot.HideGrid(); LockChartVerticalAxis(BlockingStatsBlockingEventsChart); BlockingStatsBlockingEventsChart.Refresh(); @@ -1688,7 +1687,6 @@ private void LoadBlockingStatsCharts(List data, int h BlockingStatsDurationChart.Plot.Axes.DateTimeTicksBottom(); BlockingStatsDurationChart.Plot.Axes.SetLimitsX(xMin, xMax); BlockingStatsDurationChart.Plot.YLabel("Duration (ms)"); - BlockingStatsDurationChart.Plot.HideGrid(); LockChartVerticalAxis(BlockingStatsDurationChart); BlockingStatsDurationChart.Refresh(); @@ -1718,7 +1716,6 @@ private void LoadBlockingStatsCharts(List data, int h BlockingStatsDeadlocksChart.Plot.Axes.DateTimeTicksBottom(); BlockingStatsDeadlocksChart.Plot.Axes.SetLimitsX(xMin, xMax); BlockingStatsDeadlocksChart.Plot.YLabel("Count"); - BlockingStatsDeadlocksChart.Plot.HideGrid(); LockChartVerticalAxis(BlockingStatsDeadlocksChart); BlockingStatsDeadlocksChart.Refresh(); @@ -1748,7 +1745,6 @@ private void LoadBlockingStatsCharts(List data, int h BlockingStatsDeadlockWaitTimeChart.Plot.Axes.DateTimeTicksBottom(); BlockingStatsDeadlockWaitTimeChart.Plot.Axes.SetLimitsX(xMin, xMax); BlockingStatsDeadlockWaitTimeChart.Plot.YLabel("Duration (ms)"); - BlockingStatsDeadlockWaitTimeChart.Plot.HideGrid(); LockChartVerticalAxis(BlockingStatsDeadlockWaitTimeChart); BlockingStatsDeadlockWaitTimeChart.Refresh(); } @@ -1811,8 +1807,6 @@ private void LoadLockWaitStatsChart(List data, int hoursBack, LockWaitStatsChart.Plot.YLabel("Wait Time (ms/sec)"); _legendPanels[LockWaitStatsChart] = LockWaitStatsChart.Plot.ShowLegend(ScottPlot.Edge.Bottom); LockWaitStatsChart.Plot.Legend.FontSize = 12; - LockWaitStatsChart.Plot.HideGrid(); - LockChartVerticalAxis(LockWaitStatsChart); LockWaitStatsChart.Refresh(); } @@ -2239,7 +2233,6 @@ private void LoadResourceOverviewCpuChart(IEnumerable cpuData, int ResourceOverviewCpuChart.Plot.Axes.SetLimitsX(xMin, xMax); ResourceOverviewCpuChart.Plot.Axes.SetLimitsY(0, 100); ResourceOverviewCpuChart.Plot.YLabel("CPU %"); - ResourceOverviewCpuChart.Plot.HideGrid(); LockChartVerticalAxis(ResourceOverviewCpuChart); ResourceOverviewCpuChart.Refresh(); } @@ -2302,8 +2295,6 @@ private void LoadResourceOverviewMemoryChart(IEnumerable memory ResourceOverviewMemoryChart.Plot.Axes.DateTimeTicksBottom(); ResourceOverviewMemoryChart.Plot.Axes.SetLimitsX(xMin, xMax); ResourceOverviewMemoryChart.Plot.YLabel("MB"); - ResourceOverviewMemoryChart.Plot.HideGrid(); - LockChartVerticalAxis(ResourceOverviewMemoryChart); ResourceOverviewMemoryChart.Refresh(); } @@ -2382,8 +2373,6 @@ private void LoadResourceOverviewIoChart(IEnumerable ioData, in ResourceOverviewIoChart.Plot.Axes.SetLimitsX(xMin, xMax); ResourceOverviewIoChart.Plot.Axes.AutoScaleY(); ResourceOverviewIoChart.Plot.YLabel("Latency (ms)"); - ResourceOverviewIoChart.Plot.HideGrid(); - LockChartVerticalAxis(ResourceOverviewIoChart); ResourceOverviewIoChart.Refresh(); } @@ -2456,8 +2445,6 @@ private void LoadResourceOverviewWaitChart(IEnumerable waitD ResourceOverviewWaitChart.Plot.Axes.SetLimitsX(xMin, xMax); ResourceOverviewWaitChart.Plot.Axes.AutoScaleY(); ResourceOverviewWaitChart.Plot.YLabel("Wait Time (ms/sec)"); - ResourceOverviewWaitChart.Plot.HideGrid(); - LockChartVerticalAxis(ResourceOverviewWaitChart); ResourceOverviewWaitChart.Refresh(); }