From ed6285ff16463e1d8281f5522dc8cdde23ab1b9a Mon Sep 17 00:00:00 2001 From: chomik Date: Thu, 13 Jun 2019 09:54:17 +0200 Subject: [PATCH] charts fixes --- js/app/charts.js | 2 +- pages/_data/charts.yml | 34 +++++++++++++++++++++++++++++++--- pages/_includes/js/charts.html | 6 +++--- pages/charts.html | 2 +- 4 files changed, 36 insertions(+), 8 deletions(-) diff --git a/js/app/charts.js b/js/app/charts.js index bb242f518..4a5c7b69b 100644 --- a/js/app/charts.js +++ b/js/app/charts.js @@ -93,7 +93,7 @@ if (window.Apex) { }, legend: { - show: false + show: true }, title: { diff --git a/pages/_data/charts.yml b/pages/_data/charts.yml index 3986032e6..9c8419c99 100644 --- a/pages/_data/charts.yml +++ b/pages/_data/charts.yml @@ -49,6 +49,35 @@ employment: color: green data: [17, 18, 21, 20, 30, 29] +line-chart-stroke: + name: Line chart + display: true + type: line + stroke-curve: straight + hide-legend: true + categories: ['2013', '2014', '2015', '2016', '2017', '2018', '2019'] + series: + - name: Development + color: orange + data: [8, 10, 11, 12, 20, 27, 30] + - name: Marketing + color: blue + data: [3, 16, 17, 19, 20, 30, 30] + - name: Sales + color: green + data: [7, 10, 11, 18, 18, 18, 24] + +stepline-chart: + name: Stepline + display: true + type: line + hide-legend: true + stroke-curve: stepline + series: + - name: Development + color: orange + data: [34, 44, 54, 21, 12, 43, 33, 23, 66, 66, 58] + temperature: name: Monthly Average Temperature display: true @@ -199,7 +228,6 @@ pie: name: Lorem ipsum display: true type: pie - hide-legend: true series: - name: A color: blue-darker @@ -218,7 +246,6 @@ donut: name: Lorem ipsum display: true type: donut - hide-legend: true series: - name: Maximum color: green @@ -280,6 +307,7 @@ new-clients: days-labels-count: 30 sparkline: true dashed-history: true + hide-legend: true series: - name: May color: blue @@ -326,7 +354,7 @@ usd-eur: type: line days-labels-count: 30 auto-min: true - stroke-straight: true + stroke-curve: straight series: - name: USD/EUR color: black diff --git a/pages/_includes/js/charts.html b/pages/_includes/js/charts.html index 5e13958e4..40c9e2f0a 100644 --- a/pages/_includes/js/charts.html +++ b/pages/_includes/js/charts.html @@ -26,14 +26,14 @@ $(document).ready(function(){ }, {% endif %} - {% if data.dashed-history or data.stroke-straight %} + {% if data.dashed-history or data.stroke-curve %} stroke: { {% if data.dashed-history %} width: [2, 1], dashArray: [0, 3], {% endif %} - {% if data.stroke-straight %} - curve: 'straight', + {% if data.stroke-curve %} + curve: '{{ data.stroke-curve }}', {% endif %} }, {% endif %} diff --git a/pages/charts.html b/pages/charts.html index 2d62ea48d..022ab4b26 100644 --- a/pages/charts.html +++ b/pages/charts.html @@ -11,7 +11,7 @@ menu: charts
-

{{ chart[1].name }} {{ chart[0] }}

+

{{ chart[1].name }}