Add charts.js plugin, basic chart component

This commit is contained in:
2018-07-14 16:36:23 +02:00
parent 6efc3ea790
commit 7a35f5177c
7 changed files with 207 additions and 28 deletions
@@ -0,0 +1,22 @@
import Component from '@ember/component';
export default Component.extend({
chartData: {
datasets: [{
data: [10, 20, 30]
}],
labels: [
'Red',
'Yellow',
'Blue'
]
},
chartOptions: {
legend: {
display: false
}
}
});
@@ -0,0 +1,5 @@
{{ember-chart type='doughnut'
data=chartData
options=chartOptions
width=200
height=200}}
+2 -2
View File
@@ -10,7 +10,7 @@ main {
display: grid;
grid-row-gap: 2rem;
grid-template-areas:
"people"
"stats"
"contributions";
}
}
@@ -22,7 +22,7 @@ main {
grid-row-gap: 2rem;
grid-template-columns: 2fr 4fr;
grid-template-areas:
"people contributions";
"stats contributions";
}
}
}
+23 -12
View File
@@ -1,18 +1,29 @@
<main id="index">
<section id="people">
<header>
<h2>Contributors</h2>
</header>
<div class="content">
{{contributor-list contributors=contributorsSorted}}
<div id="stats">
<section id="people">
<header>
<h2>Contributors</h2>
</header>
<div class="content">
{{contributor-list contributors=contributorsSorted}}
<p class="stats">
<span class="number">{{await kredits.totalSupply}}</span> kredits issued and distributed among
<span class="number">{{contributorsWithKredits.length}}</span> contributors.
</p>
</div>
</section>
<p class="stats">
<span class="number">{{await kredits.totalSupply}}</span> kredits issued and distributed among
<span class="number">{{contributorsWithKredits.length}}</span> contributors.
</p>
</div>
</section>
<section id="contributions-by-type">
<header>
<h2>Contributions by type</h2>
</header>
<div class="content">
{{chart-contributions-by-type contributions=proposalsClosed}}
</div>
</section>
</div>
<div id="contributions">
{{#if proposalsOpen}}