Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 19 additions & 23 deletions Dashboard/Controls/QueryPerformanceContent.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -915,18 +915,13 @@ private void LoadDurationChart(WpfPlot chart, IEnumerable<DurationTrendItem> tre
dataList.Select(d => d.CollectionTime),
dataList.Select(d => d.AvgDurationMs));

if (xs.Length > 0)
{
var scatter = chart.Plot.Add.Scatter(xs, ys);
scatter.LineWidth = 2;
scatter.MarkerSize = 5;
scatter.Color = color;
scatter.LegendText = legendText;

_legendPanels[chart] = chart.Plot.ShowLegend(ScottPlot.Edge.Bottom);
chart.Plot.Legend.FontSize = 12;
}
else
var scatter = chart.Plot.Add.Scatter(xs, ys);
scatter.LineWidth = 2;
scatter.MarkerSize = 5;
scatter.Color = color;
scatter.LegendText = legendText;

if (xs.Length == 0)
{
double xCenter = xMin + (xMax - xMin) / 2;
var noDataText = chart.Plot.Add.Text("No data for selected time range", xCenter, 0.5);
Expand All @@ -935,6 +930,9 @@ private void LoadDurationChart(WpfPlot chart, IEnumerable<DurationTrendItem> tre
noDataText.LabelAlignment = ScottPlot.Alignment.MiddleCenter;
}

_legendPanels[chart] = chart.Plot.ShowLegend(ScottPlot.Edge.Bottom);
chart.Plot.Legend.FontSize = 12;

chart.Plot.Axes.DateTimeTicksBottom();
chart.Plot.Axes.SetLimitsX(xMin, xMax);
chart.Plot.YLabel("Duration (ms/sec)");
Expand Down Expand Up @@ -971,18 +969,13 @@ private void LoadExecChart(IEnumerable<ExecutionTrendItem> execTrends, int hours
dataList.Select(d => d.CollectionTime),
dataList.Select(d => (double)d.ExecutionsPerSecond));

if (xs.Length > 0)
{
var scatter = QueryPerfTrendsExecChart.Plot.Add.Scatter(xs, ys);
scatter.LineWidth = 2;
scatter.MarkerSize = 5;
scatter.Color = ScottPlot.Colors.Blue;
scatter.LegendText = "Executions/sec";
var scatter = QueryPerfTrendsExecChart.Plot.Add.Scatter(xs, ys);
scatter.LineWidth = 2;
scatter.MarkerSize = 5;
scatter.Color = ScottPlot.Colors.Blue;
scatter.LegendText = "Executions/sec";

_legendPanels[QueryPerfTrendsExecChart] = QueryPerfTrendsExecChart.Plot.ShowLegend(ScottPlot.Edge.Bottom);
QueryPerfTrendsExecChart.Plot.Legend.FontSize = 12;
}
else
if (xs.Length == 0)
{
double xCenter = xMin + (xMax - xMin) / 2;
var noDataText = QueryPerfTrendsExecChart.Plot.Add.Text("No data for selected time range", xCenter, 0.5);
Expand All @@ -991,6 +984,9 @@ private void LoadExecChart(IEnumerable<ExecutionTrendItem> execTrends, int hours
noDataText.LabelAlignment = ScottPlot.Alignment.MiddleCenter;
}

_legendPanels[QueryPerfTrendsExecChart] = QueryPerfTrendsExecChart.Plot.ShowLegend(ScottPlot.Edge.Bottom);
QueryPerfTrendsExecChart.Plot.Legend.FontSize = 12;

QueryPerfTrendsExecChart.Plot.Axes.DateTimeTicksBottom();
QueryPerfTrendsExecChart.Plot.Axes.SetLimitsX(xMin, xMax);
QueryPerfTrendsExecChart.Plot.YLabel("Executions/sec");
Expand Down