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:
@@ -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 %}
|
||||
Reference in New Issue
Block a user