Grafana dashboard: COVID-19
Description: Coronavirus (COVID-19) infection statistics for Italy


{
  "__inputs": [
    {
      "name": "DS_MYMYSQL",
      "label": "MyMySQL",
      "description": "",
      "type": "datasource",
      "pluginId": "mysql",
      "pluginName": "MySQL"
    }
  ],
  "__requires": [
    {
      "type": "panel",
      "id": "bargauge",
      "name": "Bar Gauge",
      "version": ""
    },
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "6.6.2"
    },
    {
      "type": "panel",
      "id": "grafana-worldmap-panel",
      "name": "Worldmap Panel",
      "version": "0.2.1"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "mysql",
      "name": "MySQL",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "text",
      "name": "Text",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": 12008,
  "graphTooltip": 1,
  "id": null,
  "iteration": 1584256726282,
  "links": [],
  "panels": [
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_MYMYSQL}",
      "fill": 0,
      "fillGradient": 0,
      "gridPos": {
        "h": 8,
        "w": 14,
        "x": 0,
        "y": 0
      },
      "hiddenSeries": false,
      "id": 3,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 3,
      "nullPointMode": "null",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pointradius": 6,
      "points": true,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "sum(totale_casi)",
          "color": "#E0B400"
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "format": "time_series",
          "group": [],
          "metricColumn": "denominazione_regione",
          "rawQuery": true,
          "rawSql": "SELECT\n  date_add(data, interval 18 hour) AS \"time\",\n  sum(totale_casi)\nFROM covid19.province\ngroup by data\nORDER BY data",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "covid19.province",
          "timeColumn": "data",
          "where": []
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [
        {
          "colorMode": "gray",
          "fill": true,
          "fillColor": "rgba(234, 112, 112, 0.12)",
          "fromDayOfWeek": 6,
          "line": false,
          "lineColor": "rgba(237, 46, 24, 0.60)",
          "op": "time",
          "toDayOfWeek": 7
        }
      ],
      "timeShift": null,
      "title": "National trend",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "none",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "circleMaxSize": 30,
      "circleMinSize": 2,
      "colors": [
        "#73BF69",
        "rgba(237, 129, 40, 0.89)",
        "#F2495C"
      ],
      "datasource": "${DS_MYMYSQL}",
      "decimals": 0,
      "esMetric": "Count",
      "gridPos": {
        "h": 22,
        "w": 10,
        "x": 14,
        "y": 0
      },
      "hideEmpty": false,
      "hideZero": false,
      "id": 5,
      "initialZoom": "6",
      "locationData": "table",
      "mapCenter": "custom",
      "mapCenterLatitude": "43",
      "mapCenterLongitude": "12",
      "maxDataPoints": 1,
      "mouseWheelZoom": false,
      "options": {},
      "showLegend": true,
      "stickyLabels": false,
      "tableQueryOptions": {
        "geohashField": "geohash",
        "labelField": "denominazione_provincia",
        "latitudeField": "latitude",
        "longitudeField": "longitude",
        "metricField": "tot",
        "queryType": "coordinates"
      },
      "targets": [
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT \n  longitude, latitude, denominazione_provincia, max(totale_casi) as tot\nFROM covid19.province\nwhere longitude<>0\n  and  $__timeFilter(data)\ngroup by longitude, latitude, denominazione_provincia\norder by longitude, latitude, denominazione_provincia",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "codice_regione"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "covid19.province",
          "timeColumn": "data",
          "where": []
        }
      ],
      "thresholds": "10,100",
      "timeFrom": null,
      "timeShift": null,
      "title": "",
      "transparent": true,
      "type": "grafana-worldmap-panel",
      "unitPlural": "",
      "unitSingle": "",
      "valueName": "total"
    },
    {
      "datasource": "${DS_MYMYSQL}",
      "gridPos": {
        "h": 7,
        "w": 14,
        "x": 0,
        "y": 8
      },
      "id": 9,
      "options": {
        "displayMode": "lcd",
        "fieldOptions": {
          "calcs": [
            "mean"
          ],
          "defaults": {
            "mappings": [],
            "thresholds": {
              "mode": "absolute",
              "steps": [
                {
                  "color": "green",
                  "value": null
                },
                {
                  "color": "#EAB839",
                  "value": 100
                },
                {
                  "color": "red",
                  "value": 1000
                }
              ]
            }
          },
          "overrides": [],
          "values": true
        },
        "orientation": "vertical",
        "showUnfilled": true
      },
      "pluginVersion": "6.6.2",
      "targets": [
        {
          "format": "time_series",
          "group": [],
          "metricColumn": "denominazione_regione",
          "rawQuery": true,
          "rawSql": "select date_add(time1, interval 1 day) as \"time\", sum2-sum1 Delta\n  from (SELECT data AS \"time1\", sum(totale_casi) AS sum1 FROM covid19.province group by data) a,\n       (SELECT date_sub(data, interval 1 day) AS \"time2\", sum(totale_casi) AS sum2 FROM covid19.province group by data) b\n where time1=time2\n union \n select STR_TO_DATE('2020-02-24', '%Y-%m-%d'), 0\n  order by 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "covid19.province",
          "timeColumn": "data",
          "where": []
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Differential (new infections)",
      "type": "bargauge"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_MYMYSQL}",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 8,
        "w": 7,
        "x": 0,
        "y": 15
      },
      "hiddenSeries": false,
      "id": 2,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "format": "time_series",
          "group": [],
          "metricColumn": "denominazione_regione",
          "rawQuery": true,
          "rawSql": "SELECT\n  date_add(data, interval 18 hour) AS \"time\",\n  denominazione_regione AS metric,\n  sum(totale_casi)\nFROM covid19.province\ngroup by denominazione_regione, data\nORDER BY data, denominazione_regione",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "covid19.province",
          "timeColumn": "data",
          "where": []
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Infected by Region",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "none",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_MYMYSQL}",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 8,
        "w": 7,
        "x": 7,
        "y": 15
      },
      "hiddenSeries": false,
      "id": 6,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "format": "time_series",
          "group": [],
          "metricColumn": "denominazione_regione",
          "rawQuery": true,
          "rawSql": "SELECT\n  date_add(data, interval 18 hour) AS \"time\",\n  denominazione_provincia AS metric,\n  sum(totale_casi)\nFROM covid19.province\nwhere denominazione_regione='$Regione'\ngroup by denominazione_provincia, data\nORDER BY data, denominazione_provincia",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "covid19.province",
          "timeColumn": "data",
          "where": []
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Infected by Province (choosen Region)",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "none",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "content": "<a href=\"https://github.com/meob/my2Collector\">Github</a>",
      "datasource": "${DS_MYMYSQL}",
      "gridPos": {
        "h": 1,
        "w": 10,
        "x": 14,
        "y": 22
      },
      "id": 8,
      "links": [],
      "mode": "html",
      "options": {},
      "targets": [
        {
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": false,
          "rawSql": "SELECT\n  c1 AS \"time\",\n  v1\nFROM mylog\nWHERE\n  $__timeFilter(c1)\nORDER BY c1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "v1"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "mylog",
          "timeColumn": "c1",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Datasource: https://github.com/pcm-dpc/COVID-19",
      "transparent": true,
      "type": "text"
    }
  ],
  "refresh": false,
  "schemaVersion": 22,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_MYMYSQL}",
        "definition": "select distinct denominazione_regione from covid19.province",
        "hide": 0,
        "includeAll": false,
        "label": "Region",
        "multi": false,
        "name": "Regione",
        "options": [],
        "query": "select distinct denominazione_regione from covid19.province",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "2020-02-22T23:00:00.000Z",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "COVID-19",
  "uid": "mpb6UnuWk",
  "version": 15,
  "description": "Coronavirus (COVID-19) infection statistics for Italy"
}