This commit is contained in:
2019-04-22 17:28:56 +02:00
parent bf8ddcb738
commit a1e1d43a6f

View File

@@ -101,7 +101,7 @@ namespace PlantBox.Client.Forms.Plant
uint count; uint count;
float step; float step;
string labelFormat; string labelFormat;
string valueSpecifier; string valueFormat;
switch (viewModel.HistoricDuration.Interval) switch (viewModel.HistoricDuration.Interval)
{ {
@@ -148,15 +148,15 @@ namespace PlantBox.Client.Forms.Plant
{ {
case CaptorType.Humidity: case CaptorType.Humidity:
values = historicEntries.Humidities; values = historicEntries.Humidities;
valueSpecifier = "{0:F1} %"; valueFormat = "{0:F1} %";
break; break;
case CaptorType.Luminosity: case CaptorType.Luminosity:
values = historicEntries.Luminosities; values = historicEntries.Luminosities;
valueSpecifier = "{0:F0} lux"; valueFormat = "{0:F0} lux";
break; break;
case CaptorType.Temperature: case CaptorType.Temperature:
values = historicEntries.Temperatures; values = historicEntries.Temperatures;
valueSpecifier = "{0:F1} °C"; valueFormat = "{0:F1} °C";
break; break;
default: default:
throw new InvalidOperationException(); throw new InvalidOperationException();
@@ -174,7 +174,7 @@ namespace PlantBox.Client.Forms.Plant
entries[index] = new Entry((float)value.Value) entries[index] = new Entry((float)value.Value)
{ {
Label = value.Date.ToString(labelFormat), Label = value.Date.ToString(labelFormat),
ValueLabel = string.Format(valueSpecifier, value.Value), ValueLabel = string.Format(valueFormat, value.Value),
Color = colors[index] Color = colors[index]
}; };