mirror of
https://github.com/tabler/tabler.git
synced 2025-12-22 09:54:24 +04:00
Merge branches 'tabler-v1' and 'tabler-v1-charts' of https://github.com/tabler/tabler into tabler-v1
This commit is contained in:
@@ -45,28 +45,13 @@ charts default configuration
|
|||||||
*/
|
*/
|
||||||
if (window.Apex) {
|
if (window.Apex) {
|
||||||
|
|
||||||
|
var borderColor = 'rgba(0, 0, 0, 0.09)';
|
||||||
|
var mutedColor = '#888e9a';
|
||||||
|
|
||||||
window.Apex = {
|
window.Apex = {
|
||||||
grid: {
|
|
||||||
show: false,
|
|
||||||
padding: {
|
|
||||||
right: 0,
|
|
||||||
left: 0,
|
|
||||||
bottom: 0,
|
|
||||||
top: 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
dataLabels: {
|
|
||||||
enabled: false
|
|
||||||
},
|
|
||||||
|
|
||||||
plotOptions: {
|
|
||||||
pie: {
|
|
||||||
expandOnClick: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
chart: {
|
chart: {
|
||||||
|
fontFamily: 'inherit',
|
||||||
|
foreColor: 'inherit',
|
||||||
toolbar: {
|
toolbar: {
|
||||||
show: false,
|
show: false,
|
||||||
},
|
},
|
||||||
@@ -78,6 +63,36 @@ if (window.Apex) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
grid: {
|
||||||
|
show: false,
|
||||||
|
position: 'back',
|
||||||
|
borderColor: borderColor,
|
||||||
|
padding: {
|
||||||
|
right: 0,
|
||||||
|
left: 0,
|
||||||
|
bottom: 0,
|
||||||
|
top: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
dataLabels: {
|
||||||
|
enabled: false,
|
||||||
|
offsetY: -6,
|
||||||
|
dropShadow: {
|
||||||
|
enabled: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
plotOptions: {
|
||||||
|
pie: {
|
||||||
|
expandOnClick: false,
|
||||||
|
dataLabels: {
|
||||||
|
offset: -8,
|
||||||
|
minAngleToShowLabel: 10,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
stroke: {
|
stroke: {
|
||||||
width: 2,
|
width: 2,
|
||||||
curve: 'smooth',
|
curve: 'smooth',
|
||||||
@@ -89,17 +104,30 @@ if (window.Apex) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
markers: {
|
markers: {
|
||||||
strokeWidth: 1
|
size: 0,
|
||||||
|
strokeWidth: 1,
|
||||||
|
radius: 2,
|
||||||
|
hover: {
|
||||||
|
size: 4,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
legend: {
|
legend: {
|
||||||
show: true
|
show: true,
|
||||||
|
fontSize: '14px',
|
||||||
|
markers: {
|
||||||
|
width: 8,
|
||||||
|
height: 8
|
||||||
|
},
|
||||||
|
itemMargin: {
|
||||||
|
horizontal: 0,
|
||||||
|
vertical: 8
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
title: {
|
title: {
|
||||||
style: {
|
style: {
|
||||||
fontSize: '14px',
|
fontSize: '14px',
|
||||||
fontFamily: 'inherit'
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -109,13 +137,22 @@ if (window.Apex) {
|
|||||||
|
|
||||||
xaxis: {
|
xaxis: {
|
||||||
labels: {
|
labels: {
|
||||||
show: false
|
style: {
|
||||||
|
colors: mutedColor,
|
||||||
|
fontSize: '12px',
|
||||||
|
}
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
enabled: false
|
enabled: false
|
||||||
},
|
},
|
||||||
axisBorder: {
|
axisBorder: {
|
||||||
show: false
|
color: borderColor,
|
||||||
|
height: 0
|
||||||
|
},
|
||||||
|
axisTicks: {
|
||||||
|
show: true,
|
||||||
|
height: 4,
|
||||||
|
color: borderColor
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -32,11 +32,11 @@ development-activity:
|
|||||||
color: blue
|
color: blue
|
||||||
data: [0, 5, 1, 2, 7, 5, 6, 8, 24, 7, 12, 5, 6, 3, 2, 2, 6, 30, 10, 10, 15, 14, 47, 65, 55]
|
data: [0, 5, 1, 2, 7, 5, 6, 8, 24, 7, 12, 5, 6, 3, 2, 2, 6, 30, 10, 10, 15, 14, 47, 65, 55]
|
||||||
|
|
||||||
employment:
|
line:
|
||||||
name: Employment Growth
|
name: Employment Growth
|
||||||
display: true
|
display: true
|
||||||
type: line
|
type: line
|
||||||
hide-legend: true
|
show-grid: true
|
||||||
categories: ['2013', '2014', '2015', '2016', '2017', '2018']
|
categories: ['2013', '2014', '2015', '2016', '2017', '2018']
|
||||||
series:
|
series:
|
||||||
- name: Development
|
- name: Development
|
||||||
@@ -49,12 +49,13 @@ employment:
|
|||||||
color: green
|
color: green
|
||||||
data: [17, 18, 21, 20, 30, 29]
|
data: [17, 18, 21, 20, 30, 29]
|
||||||
|
|
||||||
line-chart-stroke:
|
line-stroke:
|
||||||
name: Line chart
|
name: Line chart
|
||||||
display: true
|
display: true
|
||||||
type: line
|
type: line
|
||||||
stroke-curve: straight
|
stroke-curve: straight
|
||||||
hide-legend: true
|
hide-legend: true
|
||||||
|
show-grid: true
|
||||||
categories: ['2013', '2014', '2015', '2016', '2017', '2018', '2019']
|
categories: ['2013', '2014', '2015', '2016', '2017', '2018', '2019']
|
||||||
series:
|
series:
|
||||||
- name: Development
|
- name: Development
|
||||||
@@ -67,12 +68,13 @@ line-chart-stroke:
|
|||||||
color: green
|
color: green
|
||||||
data: [7, 10, 11, 18, 18, 18, 24]
|
data: [7, 10, 11, 18, 18, 18, 24]
|
||||||
|
|
||||||
stepline-chart:
|
stepline:
|
||||||
name: Stepline
|
name: Stepline
|
||||||
display: true
|
display: true
|
||||||
type: line
|
type: line
|
||||||
hide-legend: true
|
hide-legend: true
|
||||||
stroke-curve: stepline
|
stroke-curve: stepline
|
||||||
|
show-grid: true
|
||||||
series:
|
series:
|
||||||
- name: Development
|
- name: Development
|
||||||
color: orange
|
color: orange
|
||||||
@@ -83,7 +85,10 @@ temperature:
|
|||||||
display: true
|
display: true
|
||||||
type: line
|
type: line
|
||||||
show-labels: true
|
show-labels: true
|
||||||
|
show-data-labels: true
|
||||||
|
show-markers: true
|
||||||
hide-legend: true
|
hide-legend: true
|
||||||
|
show-grid: true
|
||||||
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
||||||
series:
|
series:
|
||||||
- name: Tokyo
|
- name: Tokyo
|
||||||
@@ -228,6 +233,8 @@ pie:
|
|||||||
name: Lorem ipsum
|
name: Lorem ipsum
|
||||||
display: true
|
display: true
|
||||||
type: pie
|
type: pie
|
||||||
|
hide-legend: true
|
||||||
|
show-data-labels: true
|
||||||
series:
|
series:
|
||||||
- name: A
|
- name: A
|
||||||
color: blue-darker
|
color: blue-darker
|
||||||
@@ -246,6 +253,7 @@ donut:
|
|||||||
name: Lorem ipsum
|
name: Lorem ipsum
|
||||||
display: true
|
display: true
|
||||||
type: donut
|
type: donut
|
||||||
|
hide-legend: true
|
||||||
series:
|
series:
|
||||||
- name: Maximum
|
- name: Maximum
|
||||||
color: green
|
color: green
|
||||||
|
|||||||
17
pages/_includes/cards/charts/card.html
Normal file
17
pages/_includes/cards/charts/card.html
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{% if include.data %}
|
||||||
|
{% assign data = include.data %}
|
||||||
|
{% else %}
|
||||||
|
{% assign data = site.data.charts[include.name] %}
|
||||||
|
{% endif %}
|
||||||
|
{% assign key = 'chart-' | append: include.name %}
|
||||||
|
<div class="card">
|
||||||
|
{% unless include.hide-title %}
|
||||||
|
<div class="card-header">
|
||||||
|
<h3 class="card-title">{{ include.title | default: data.name }}</h3>
|
||||||
|
</div>
|
||||||
|
{% endunless %}
|
||||||
|
<div class="card-body">
|
||||||
|
<div id="{{ key }}" style="height: {{ include.height | default: 16 }}rem"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% include js/charts.html id=key chart-id=include.name %}
|
||||||
@@ -49,6 +49,18 @@ $(document).ready(function(){
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if data.show-grid %}
|
||||||
|
grid: {
|
||||||
|
show: true,
|
||||||
|
},
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if data.show-data-labels %}
|
||||||
|
dataLabels: {
|
||||||
|
enabled: true,
|
||||||
|
},
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if data.categories or data.days-labels-count %}
|
{% if data.categories or data.days-labels-count %}
|
||||||
xaxis: {
|
xaxis: {
|
||||||
{% if data.categories %}categories: [{% for category in data.categories %}'{{ category }}'{% unless forloop.last %}, {% endunless %}{% endfor %}],{% endif %}
|
{% if data.categories %}categories: [{% for category in data.categories %}'{{ category }}'{% unless forloop.last %}, {% endunless %}{% endfor %}],{% endif %}
|
||||||
@@ -95,7 +107,13 @@ $(document).ready(function(){
|
|||||||
{% if data.hide-points %}
|
{% if data.hide-points %}
|
||||||
point: {
|
point: {
|
||||||
show: false
|
show: false
|
||||||
}
|
},
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if data.show-markers %}
|
||||||
|
markers: {
|
||||||
|
size: 2
|
||||||
|
},
|
||||||
{% endif %}
|
{% endif %}
|
||||||
})).render();
|
})).render();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,18 +6,10 @@ menu: charts
|
|||||||
<div class="row row-cards">
|
<div class="row row-cards">
|
||||||
{% for chart in site.data.charts %}
|
{% for chart in site.data.charts %}
|
||||||
{% if chart[1].display %}
|
{% if chart[1].display %}
|
||||||
{% assign data = chart[0] %}
|
{% assign chart-name = chart[0] %}
|
||||||
{% assign key = 'chart-' | append: data %}
|
{% assign chart-data = chart[1] %}
|
||||||
<div class="col-lg-6 col-xl-4">
|
<div class="col-lg-6 col-xl-4">
|
||||||
<div class="card">
|
{% include cards/charts/card.html name=chart-name data=chart-data %}
|
||||||
<div class="card-header">
|
|
||||||
<h3 class="card-title">{{ chart[1].name }}</h3>
|
|
||||||
</div>
|
|
||||||
<div class="card-body">
|
|
||||||
<div id="{{ key }}" style="height: 16rem"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% include js/charts.html id=key chart-id=data %}
|
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -108,6 +108,16 @@ menu: level-1.level-2.level-3.level-4
|
|||||||
{% include cards/small-stats-3.html number=621 title="Products" percentage=-1 %}
|
{% include cards/small-stats-3.html number=621 title="Products" percentage=-1 %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="col-4">
|
||||||
|
{% include cards/charts/card.html name="temperature" title="A" height=12 %}
|
||||||
|
</div>
|
||||||
|
<div class="col-4">
|
||||||
|
{% include cards/charts/card.html name="donut" title="B" height=12 %}
|
||||||
|
</div>
|
||||||
|
<div class="col-4">
|
||||||
|
{% include cards/charts/card.html name="pie" title="C" height=12 %}
|
||||||
|
</div>
|
||||||
|
|
||||||
{% comment %}
|
{% comment %}
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
{% comment %}{% include cards/development-activity.html %}{% endcomment %}
|
{% comment %}{% include cards/development-activity.html %}{% endcomment %}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.btn-secondary {
|
.btn-secondary {
|
||||||
@include button-variant(#fff, $border-color, #fff, $border-color);
|
@include button-variant(transparent, $border-color, #fff, $border-color);
|
||||||
color: $text-muted;
|
color: $text-muted;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
4
static/libs/apexcharts/apexcharts.min.js
vendored
4
static/libs/apexcharts/apexcharts.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user