1
0
mirror of https://github.com/tabler/tabler.git synced 2026-07-30 15:04:38 +04:00

remove tabler-charts.js, peity charts, apexcharts

This commit is contained in:
codecalm
2019-12-20 23:34:14 +01:00
parent b83202d7a4
commit 004cf028cd
23 changed files with 210 additions and 378 deletions
+20 -16
View File
@@ -1,19 +1,23 @@
{% assign type = include.type %}
{% assign square = false %}
{% if type == "pie" or type == "donut" %}
{% assign square = true %}
{% endif %}
{% assign id = 0 | random_id %}
{% assign color = include.color | default: 'blue' %}
{% append_lib peity %}
<div class="sparkline{% if square %} sparkline-square{% endif %}{% if include.wide %} sparkline-wide{% endif %}" data-spark="{{ include.data }}" data-spark-type="{{ include.type }}" {% if include.color %}data-spark-color="{{ include.color | default: 'blue' | tabler_color }}" data-spark-color-bg="{{ include.color | tabler_color: '100' }}"{% endif %}>
{% if include.label %}
<div class="sparkline-label">
{{ include.label }}
</div>
{% endif %}
{% if include.label-icon %}
<div class="sparkline-label">
{% include_cached ui/icon.html icon=include.label-icon color=include.color %}
</div>
{% endif %}
</div>
<div class="chart-sparkline{% if type == 'pie' %} chart-sparkline-square{% endif %}{% if include.wide %} chart-sparkline-wide{% endif %}" id="sparkline-{{ id }}"></div>
{% capture_global scripts %}
<script>
document.addEventListener("DOMContentLoaded", function () {
$().peity && $('#sparkline-{{ id }}').text("{{ include.data }}").peity("{{ type | default: 'bar' }}", {
width: {% if type == 'pie' %}40{% else %}64{% endif %},
height: 40,
stroke: "{{ color | tabler_color }}",
strokeWidth: 2,
fill: {% if type == 'pie' %}["{{ color | default: 'blue' | tabler_color }}", "{{ 'border-color' | tabler_color }}"]{% elsif type == 'bar' %}["{{ color | tabler_color }}"]{% else %}"transparent"{% endif %},
padding: .2,
innerRadius: 16,
});
});
</script>
{% endcapture_global %}