From eb6a0216dcb9029e882d4661bdb1bb19406b1c14 Mon Sep 17 00:00:00 2001 From: codecalm Date: Wed, 4 Dec 2019 21:45:11 +0100 Subject: [PATCH] cards components, charts fixes --- .github/no-response.yml | 10 ++++ js/tabler-charts.js | 4 ++ pages/_data/charts.yml | 55 +++++++++++++++---- pages/_includes/cards/charts/total-sales.html | 9 +++ pages/_includes/ui/card-dropdown.html | 12 ++++ pages/_includes/ui/chart.html | 20 +++---- pages/_includes/ui/trending.html | 2 +- pages/tmp.html | 8 +++ scss/ui/_cards.scss | 17 +++++- 9 files changed, 112 insertions(+), 25 deletions(-) create mode 100644 .github/no-response.yml create mode 100644 pages/_includes/cards/charts/total-sales.html create mode 100644 pages/_includes/ui/card-dropdown.html diff --git a/.github/no-response.yml b/.github/no-response.yml new file mode 100644 index 000000000..27ccae058 --- /dev/null +++ b/.github/no-response.yml @@ -0,0 +1,10 @@ +# Configuration for probot-no-response - https://github.com/probot/no-response + +daysUntilClose: 28 + +closeComment: > + This issue has been automatically closed because there has been no response + to our request for more information from the original author. With only the + information that is currently in the issue, we don't have enough information + to take action. Please reach out if you have or find the answers we need so + that we can investigate further. diff --git a/js/tabler-charts.js b/js/tabler-charts.js index 8d9a34bd1..e09c743b7 100644 --- a/js/tabler-charts.js +++ b/js/tabler-charts.js @@ -84,6 +84,9 @@ if (window.Apex) { dataLabels: { minAngleToShowLabel: 10, }, + donut: { + size: '80%' + } }, }, @@ -91,6 +94,7 @@ if (window.Apex) { width: 2, curve: 'smooth', lineCap: "round", + colors: ["transparent"] }, fill: { diff --git a/pages/_data/charts.yml b/pages/_data/charts.yml index dda7bb82e..d2be3f573 100644 --- a/pages/_data/charts.yml +++ b/pages/_data/charts.yml @@ -1,3 +1,39 @@ +total-sales: + type: donut + sparkline: true + hide-legend: true + series: + - name: Direct + color: blue + data: 44 + - name: Affilliate + color: green + data: 55 + - name: Sponsored + color: red + data: 35 + - name: E-mail + color: yellow + data: 12 + +total-sales2: + type: radalBar + sparkline: true + hide-legend: true + series: + - name: Direct + color: blue + data: 44 + - name: Affilliate + color: green + data: 55 + - name: Sponsored + color: red + data: 35 + - name: E-mail + color: yellow + data: 12 + tasks: name: Tasks type: line @@ -241,16 +277,16 @@ pie: series: - name: A color: blue-darker - data: [63] + data: 63 - name: B color: blue - data: [44] + data: 44 - name: C color: blue-light - data: [12] + data: 12 - name: D color: blue-lighter - data: [14] + data: 14 donut: name: Lorem ipsum @@ -261,10 +297,10 @@ donut: series: - name: Maximum color: green - data: [63] + data: 63 - name: Minimum color: green-light - data: [37] + data: 37 scatter: @@ -376,14 +412,13 @@ devices: type: donut sparkline: true hide-legend: true - sparkline: true series: - name: a color: blue-dark - data: [23] + data: 23 - name: b color: blue - data: [54] + data: 54 - name: c color: blue-light - data: [34] + data: 34 diff --git a/pages/_includes/cards/charts/total-sales.html b/pages/_includes/cards/charts/total-sales.html new file mode 100644 index 000000000..23675dc85 --- /dev/null +++ b/pages/_includes/cards/charts/total-sales.html @@ -0,0 +1,9 @@ +
+
+ {% include ui/card-dropdown.html %} +

Total sales

+ + {% include ui/chart.html chart-id="total-sales" height=15 %} + {% include ui/chart.html chart-id="total-sales2" height=15 %} +
+
diff --git a/pages/_includes/ui/card-dropdown.html b/pages/_includes/ui/card-dropdown.html new file mode 100644 index 000000000..14a61459f --- /dev/null +++ b/pages/_includes/ui/card-dropdown.html @@ -0,0 +1,12 @@ +{% assign menu = include.menu | default: 'Import,Export,Download,Another action' | split: ',' %} +{% assign icon = include.icon | default: 'more-horizontal' %} + diff --git a/pages/_includes/ui/chart.html b/pages/_includes/ui/chart.html index 34c4165b0..201618a86 100644 --- a/pages/_includes/ui/chart.html +++ b/pages/_includes/ui/chart.html @@ -1,9 +1,9 @@ {% assign data = site.data.charts[include.chart-id] %} {% assign id = include.id | default: include.chart-id %} -{% assign height = include.height %} +{% assign height = include.height | default: 10 %} {% if data %} -
+
{% capture_global scripts %}