diff --git a/CHANGELOG.md b/CHANGELOG.md
index f1adae8ba70e45cafbc389e4e38db8de462a7938..e423896ad02dddb9a852b6bd5e5ef9bb7e8d9e72 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,10 @@
 All notable changes to this project will be documented in this file.
 
 ## [Unreleased]
+[Added]
+- Added legends to charts
+- Instance name in header is taken from config file
+
 [Fixed]
 - set default value of lastDays and tab in index.php: no error logs when user open statistics for the first time
 
diff --git a/dictionaries/Proxystatistics.definition.json b/dictionaries/Proxystatistics.definition.json
index 29ad5ff4251182579ac8653c36ddbcbb6dc10316..73c09efe2eda44426639d94f29f4783b5570eb17 100644
--- a/dictionaries/Proxystatistics.definition.json
+++ b/dictionaries/Proxystatistics.definition.json
@@ -104,7 +104,27 @@
     "cs": "Služba"
   },
   "templates/statistics_header": {
-    "en": "SimpleSAMLphp Statistics",
-    "cs": "SimpleSAMLphp Statistiky"
+    "en": "AAI Statistics",
+    "cs": "AAI Statistiky"
+  },
+  "templates/identityProviders_legend": {
+    "en": "The chart and the table show number of logins from each identity provider in selected time range.",
+    "cs": "Graf s tabulkou ukazují počet přihlášení od každého poskytovatele identity ve zvoleném časovém rozmezí."
+  },
+  "templates/serviceProviders_legend": {
+    "en": "The chart and the table show number of logins to each service provider in selected time range. Only first access to the service is counted, following single sign-on accesses are not counted, because they are not going through the Proxy.",
+    "cs": "Graf s tabulkou ukazují přihlášení ke každé službě ve zvoleném časovém rozmezí. Počítá se pouze první přístup ke službě, protože další již nejdou přes Proxy."
+  },
+  "templates/summary_logins_info": {
+    "en": "The chart shows overall number of logins from identity providers for each day.",
+    "cs": "Graf zobrazuje počet přihlášení za každý den."
+  },
+  "templates/summary_idps_info": {
+    "en": "The chart shows number of logins from each identity provider in selected time range.",
+    "cs": "Graf zobrazuje počet přihlášení od každého poskytovatele identity ve zvoleném časovém rozmezí."
+  },
+  "templates/summary_sps_info": {
+    "en": "The chart shows number of logins to each service provider in selected time range. Only first access to the service is counted, following single sign-on accesses are not counted, because they are not going through the Proxy.",
+    "cs": "Graf zobrazuje počet přihlášení ke každé službě ve zvoleném časovém rozmezí. Počítá se pouze první přístup ke službě, následující přístupy neprocházejí přes Proxy."
   }
 }
diff --git a/templates/identityProviders-tpl.php b/templates/identityProviders-tpl.php
index 4089826cb485fd12f5170257633e25ed6eb82f2e..8d83031c426255cfee594d8897485448c31f6783 100644
--- a/templates/identityProviders-tpl.php
+++ b/templates/identityProviders-tpl.php
@@ -69,6 +69,9 @@ $lastDays = $this->data['lastDays'];
 </div>
 
 <h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/graphs_id_providers}'); ?></h2>
+<div class="legend">
+    <div><?php echo $this->t('{proxystatistics:Proxystatistics:templates/identityProviders_legend}'); ?></div>
+</div>
 <div class="row">
     <div class="col-md-8">
         <div id="idpsChartDetail" ></div>
diff --git a/templates/serviceProviders-tpl.php b/templates/serviceProviders-tpl.php
index 31ac1b98fa73c037b15c87e1f8b9a58e73637839..757b5e5245731d92eddff251328081bc65f8c010 100644
--- a/templates/serviceProviders-tpl.php
+++ b/templates/serviceProviders-tpl.php
@@ -69,6 +69,9 @@ $lastDays = $this->data['lastDays'];
 </div>
 
 <h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/graphs_service_providers}'); ?></h2>
+<div class="legend">
+    <div><?php echo $this->t('{proxystatistics:Proxystatistics:templates/serviceProviders_legend}'); ?></div>
+</div>
 <div class="row">
     <div class="col-md-8">
         <div id="spsChartDetail" ></div>
diff --git a/templates/statistics-tpl.php b/templates/statistics-tpl.php
index 524a992c6fa3d74858b4af5951dce7046d417057..7cc6111e2d52155ea0caa8195627965d90d3d8ea 100644
--- a/templates/statistics-tpl.php
+++ b/templates/statistics-tpl.php
@@ -4,7 +4,17 @@ include dirname(__DIR__)."/lib/Auth/Process/DatabaseCommand.php";
  * @author Pavel Vyskočil <vyskocilpavel@muni.cz>
  * @author Dominik Baránek <0Baranek.dominik0@gmail.com>
  */
-$this->data['header'] = $this->t('{proxystatistics:Proxystatistics:templates/statistics_header}');
+const CONFIG_FILE_NAME = 'config.php';
+const INSTANCE_NAME = 'instance_name';
+
+$config = SimpleSAML_Configuration::getConfig(CONFIG_FILE_NAME);
+$instanceName = $config->getString(INSTANCE_NAME, null);
+if (!is_null($instanceName)) {
+    $this->data['header'] = $instanceName . ' ' . $this->t('{proxystatistics:Proxystatistics:templates/statistics_header}');
+} else {
+    $this->data['header'] = $this->t('{proxystatistics:Proxystatistics:templates/statistics_header}');
+    SimpleSAML\Logger::warning('Missing configuration: config.php - instance_name is not set.');
+}
 
 $this->data['jquery'] = array('core' => TRUE, 'ui' => TRUE, 'css' => TRUE);
 $this->data['head'] = '<link rel="stylesheet"  media="screen" type="text/css" href="' . SimpleSAML\Module::getModuleUrl('proxystatistics/statisticsproxy.css')  . '" />';
diff --git a/templates/summary-tpl.php b/templates/summary-tpl.php
index 72e008ed98c638ac2f7685dedf884f341cd3eaf5..2206810e1f9cef9da1c4ae11cb4828229264b348 100644
--- a/templates/summary-tpl.php
+++ b/templates/summary-tpl.php
@@ -105,6 +105,11 @@ $lastDays = $this->data['lastDays'];
 </div>
 
 <h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/graphs_logins}'); ?></h2>
+<div class="legend-logins">
+    <div>
+        <?php echo $this->t('{proxystatistics:Proxystatistics:templates/summary_logins_info}'); ?>
+    </div>
+</div>
 <div id="loginsDashboard" >
     <div id="line_div"></div>
     <div id="control_div"></div>
@@ -113,10 +118,20 @@ $lastDays = $this->data['lastDays'];
 <div class="row tableMaxHeight">
     <div class="col-md-6 graph">
         <h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/graphs_id_providers}'); ?></h2>
+        <div class="legend">
+            <div id="summaryIdp">
+                <?php echo $this->t('{proxystatistics:Proxystatistics:templates/summary_idps_info}'); ?>
+            </div>
+        </div>
         <div id="idpsChart" ></div>
     </div>
     <div class="col-md-6">
         <h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/graphs_service_providers}'); ?></h2>
+        <div class="legend">
+            <div>
+                <?php echo $this->t('{proxystatistics:Proxystatistics:templates/summary_sps_info}'); ?>
+            </div>
+        </div>
         <div id="spsChart" ></div>
     </div>
 </div>
diff --git a/www/statisticsproxy.css b/www/statisticsproxy.css
index 842f3224bd42885cb37cad19e76302c0ddeeda3f..c71d5d54b7e7a6466fccf988750e8c2f2d842044 100644
--- a/www/statisticsproxy.css
+++ b/www/statisticsproxy.css
@@ -43,6 +43,10 @@ table{
     font-weight: normal;
 }
 
+#summaryIdp {
+    padding-bottom: 20px;
+}
+
 .tabset_tabs {
     padding-left: 20px;
 }
@@ -50,3 +54,12 @@ table{
 .timeRange {
     padding-left: 40px;
 }
+
+.legend-logins {
+    padding-left: 40px;
+}
+
+.legend {
+    padding-left: 40px;
+    padding-bottom: 20px;
+}