This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2021-04-10 04:04:16 -07:00
|
|
|
<template>
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-header">
|
|
|
|
<div class="form-check form-check-inline"
|
|
|
|
v-for="(desc, m) in {'': 'Hide chart', 'daily': 'Daily new chart', 'cumulative': 'Cumulative chart'}">
|
|
|
|
<label class="form-check-label">
|
|
|
|
<input class="form-check-input" type="radio" v-model="mode" :value="m">
|
|
|
|
{{desc}}
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="card-body" v-if="mode">
|
2022-04-04 13:50:39 -07:00
|
|
|
<Chart :data="data" :label="`new ${name} per day`" v-show="mode === 'daily'"/>
|
|
|
|
<Chart :data="data" :label="`cumulative ${name}`" cumulative v-show="mode === 'cumulative'"/>
|
2021-04-10 04:04:16 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
name: { required: true },
|
|
|
|
data: { required: true },
|
|
|
|
init: { 'default': '' },
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
mode: this.init,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|