提交 c2558cc3 编写于 作者: C codecalm

homepage charts fixes

上级 d3a8cb07
...@@ -20,4 +20,16 @@ ...@@ -20,4 +20,16 @@
visitors: 986 visitors: 986
unique: 865 unique: 865
bounce-rate: 44.89% bounce-rate: 44.89%
data: 9, 6, 14, 11, 8, 24, 2, 16, 15 data: 6, 15, 13, 13, 5, 7, 17, 20, 19
- uri: /colors.html
visitors: 912
unique: 822
bounce-rate: 41.12%
data: 2, 11, 15, 14, 21, 20, 8, 23, 18, 14
- uri: /docs/index.html
visitors: 855
unique: 798
bounce-rate: 32.65%
data: 22, 12, 7, 14, 3, 21, 8, 23, 18, 14
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<div class="card-header"> <div class="card-header">
<h3 class="card-title">Most Visited Pages</h3> <h3 class="card-title">Most Visited Pages</h3>
</div> </div>
<div class="table-responsive"> <div class="card-table table-responsive">
<table class="table card-table table-vcenter"> <table class="table table-vcenter">
<thead> <thead>
<tr> <tr>
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
{% for page in site.data.pages %} {% for page in site.data.pages %}
{% assign data = page.data | join: ',' %} {% assign data = page.data | join: ',' %}
{% assign id = "bounce-rate-" | append: forloop.index %}
<tr> <tr>
<td> <td>
{{ page.uri }} {{ page.uri }}
...@@ -25,7 +26,7 @@ ...@@ -25,7 +26,7 @@
<td class="text-muted">{{ page.unique | format_number }}</td> <td class="text-muted">{{ page.unique | format_number }}</td>
<td class="text-muted">{{ page.bounce-rate }}</td> <td class="text-muted">{{ page.bounce-rate }}</td>
<td class="text-right w-1"> <td class="text-right w-1">
{% include ui/chart-sparkline.html type="line" data=data %} {% include ui/chart-sparkline.html type="line" data=data id=id small=true %}
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
{% assign id = include.id %} {% assign id = include.id %}
{% assign color = include.color | default: 'blue' %} {% assign color = include.color | default: 'blue' %}
{% assign height = include.height | default: 2.5 %} {% assign height = include.height | default: 2.5 %}
{% if include.small %}
{% assign height = include.height | default: 1.5 %}
{% endif %}
{% assign data = include.data %} {% assign data = include.data %}
{% if include.percentage %} {% if include.percentage %}
...@@ -9,7 +12,7 @@ ...@@ -9,7 +12,7 @@
{% endif %} {% endif %}
{% if id %} {% if id %}
<div class="chart-sparkline{% if type == 'pie' or type == 'donut' %} chart-sparkline-square{% endif %}{% if include.wide %} chart-sparkline-wide{% endif %}" id="sparkline-{{ id }}"></div> <div class="chart-sparkline{% if type == 'pie' or type == 'donut' %} chart-sparkline-square{% endif %}{% if include.wide %} chart-sparkline-wide{% endif %}{% if include.small %} chart-sparkline-sm{% endif %}" id="sparkline-{{ id }}"></div>
{% capture_global scripts %} {% capture_global scripts %}
<script> <script>
...@@ -53,6 +56,13 @@ ...@@ -53,6 +56,13 @@
} }
}, },
{% endif %} {% endif %}
{% if type == 'area' %}
fill: {
gradient: {
opacityFrom: [.1, .1]
}
},
{% endif %}
{% if type == 'area' or type == 'line' %} {% if type == 'area' or type == 'line' %}
stroke: { stroke: {
width: 2, width: 2,
......
...@@ -287,7 +287,7 @@ Card status ...@@ -287,7 +287,7 @@ Card status
Card table Card table
*/ */
.card-table { .card-table {
margin-bottom: 0; margin-bottom: 0 !important;
tr { tr {
.card-header ~ .table-responsive &, .card-header ~ .table-responsive &,
......
...@@ -30,6 +30,10 @@ Chart sparkline ...@@ -30,6 +30,10 @@ Chart sparkline
min-height: 0 !important; min-height: 0 !important;
} }
.chart-sparkline-sm {
height: 1.5rem;
}
.chart-sparkline-square { .chart-sparkline-square {
width: 2.5rem; width: 2.5rem;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册