Commit 0ec10e3b authored by Andreas Müller's avatar Andreas Müller
Browse files

Kleinere Fixes für saubere Darstellung der Werte

parent 026ff37e
......@@ -12,9 +12,9 @@ using Serilog;
namespace CovidTable
{
internal class Program
public class Program
{
internal static string AppVersion { get; private set; }
public static string AppVersion { get; private set; }
public static int Main(string[] args)
{
......
......@@ -289,6 +289,78 @@
//#region Tables
let drawChart = function (canvas, data) {
new Chart(canvas, {
type: 'line',
data: data,
options: {
responsive: false,
tooltips: {
mode: 'index',
intersect: false,
callbacks: {
label: function (item, data) {
let label = data.datasets[item.datasetIndex].label || '';
if (label)
label += ': ';
label += de.format(item.yLabel);
return label;
}
}
},
hover: {
mode: 'nearest',
intersect: true
},
scales: {
xAxes: [
{
display: true,
scaleLabel: {
display: true,
labelString: 'Datum'
}
}
],
yAxes: [
{
display: true,
scaleLabel: {
display: true,
labelString: 'Erkrankte'
},
ticks: {
callback: function (value) {
return de.format(value);
}
},
position: 'left',
id: 'y1'
},
{
display: true,
scaleLabel: {
display: true,
labelString: 'Inzidenz'
},
ticks: {
callback: function (value) {
return de.format(value);
}
},
position: 'right',
id: 'y2',
gridLines: {
drawOnChartArea: false
}
}
]
}
}
});
};
let createKmRow = function (row, buttons) {
if (buttons === null || buttons === undefined)
buttons = [];
......@@ -422,7 +494,7 @@
};
graphData.datasets.push({
label: data.name + ': Erkrankte',
label: 'Erkrankte',
borderColor: '#294190',
backgroundColor: '#294190',
yAxisID: 'y1',
......@@ -430,7 +502,7 @@
data: []
});
graphData.datasets.push({
label: data.name + ': Inzidenzwert',
label: 'Inzidenzwert',
borderColor: '#ffc000',
backgroundColor: '#ffc000',
yAxisID: 'y2',
......@@ -445,55 +517,7 @@
graphData.datasets[1].data.push(Math.round(entry.inzidenz * 100) / 100);
}
new Chart(graph, {
type: 'line',
data: graphData,
options: {
responsive: false,
tooltips: {
mode: 'index',
intersect: false
},
hover: {
mode: 'nearest',
intersect: true
},
scales: {
xAxes: [
{
display: true,
scaleLabel: {
display: true,
labelString: 'Datum'
}
}
],
yAxes: [
{
display: true,
scaleLabel: {
display: true,
labelString: 'Erkrankte'
},
position: 'left',
id: 'y1'
},
{
display: true,
scaleLabel: {
display: true,
labelString: 'Inzidenzwert'
},
position: 'right',
id: 'y2',
gridLines: {
drawOnChartArea: false
}
}
]
}
}
});
drawChart(graph, graphData);
});
//#region Favourites
......@@ -849,55 +873,7 @@
graphData.datasets[1].data.push(inzidenz);
}
new Chart(graph, {
type: 'line',
data: graphData,
options: {
responsive: false,
tooltips: {
mode: 'index',
intersect: false
},
hover: {
mode: 'nearest',
intersect: true
},
scales: {
xAxes: [
{
display: true,
scaleLabel: {
display: true,
labelString: 'Datum'
}
}
],
yAxes: [
{
display: true,
scaleLabel: {
display: true,
labelString: 'Erkrankte'
},
position: 'left',
id: 'y1'
},
{
display: true,
scaleLabel: {
display: true,
labelString: 'Inzidenzwert'
},
position: 'right',
id: 'y2',
gridLines: {
drawOnChartArea: false
}
}
]
}
}
});
drawChart(graph, graphData);
if (show) {
$('#bund-inzidenz').html(de.format(inzidenz) + ' (<span class="text-' + (dInzidenz > 0 ? 'danger' : dInzidenz < 0 ? 'success' : 'muted') + '">' + (dInzidenz > 0 ? '+' : '') + de.format(dInzidenz) + '</span>)');
......
......@@ -5,6 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>@ViewBag.Title</title>
<meta name="description" content="Covid19 Übersicht Deutschland v@(Program.AppVersion) | Letztes Update: @(ViewBag.LastUpdate)">
<link rel="shortcut icon" type="image/x-icon" href="~/favicon.ico">
<environment include="Development">
......@@ -17,7 +18,7 @@
<link rel="stylesheet" href="~/lib/fontawesome/css/all.min.css">
<link rel="stylesheet" href="~/lib/chart.js/dist/Chart.min.css">
</environment>
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true">
<link rel="stylesheet" href="~/css/site.css?v=@(Program.AppVersion)">
</head>
<body>
<div class="container">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment