discourse/app/assets/javascripts/admin/templates/components/dashboard-mini-chart.hbs
Joffrey JAFFEUX 2b8307c6c3
dashboard next: minor improvements
* rename route to dashboard-next
* better scaling of charts for large data sets
* adjust trend position to avoid overlap
* makes sure silenced/suspended is made on real users
* correctly format data when only one data point
* minor refactoring
2018-04-17 11:01:06 +02:00

27 lines
614 B
Handlebars

{{#conditional-loading-spinner condition=isLoading}}
<div class="chart-title">
<h3>{{title}}</h3>
{{#if help}}
{{d-icon "question-circle" title=help}}
{{/if}}
</div>
<div class="chart-container">
{{#if oneDataPoint}}
<span class="data-point">
{{number chartData.lastObject.y}}
</span>
{{else}}
<div class="chart-trend {{trend}}">
<span>{{number total}}</span>
{{#if trendIcon}}
{{d-icon trendIcon}}
{{/if}}
</div>
<canvas class="chart-canvas"></canvas>
{{/if}}
</div>
{{/conditional-loading-spinner}}