-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e4148be
commit f5cde1f
Showing
12 changed files
with
1,009 additions
and
8,866 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,67 @@ | ||
<template> | ||
<section class="k-modified-section podcaster"> | ||
<apexchart height="300" :options="options" :series="series"></apexchart> | ||
</section> | ||
<section class="k-modified-section podcaster"> | ||
<apexchart height="300" :options="options" :series="series"></apexchart> | ||
</section> | ||
</template> | ||
<script> | ||
import VueApexCharts from 'vue-apexcharts' | ||
export default { | ||
components: {'apexchart': VueApexCharts}, | ||
props: { | ||
selectedMonth: Number, | ||
selectedYear: Number, | ||
selectedPodcast: String, | ||
}, | ||
data() { | ||
return { | ||
options: { | ||
chart: { | ||
id: 'devices-month', | ||
type: 'pie' | ||
}, | ||
theme: { | ||
palette: 'palette3' | ||
}, | ||
}, | ||
components: { apexchart: VueApexCharts }, | ||
props: { | ||
selectedMonth: Number, | ||
selectedYear: Number, | ||
selectedPodcast: String, | ||
themeMode: String, | ||
}, | ||
data() { | ||
return { | ||
options: { | ||
chart: { | ||
id: 'devices-month', | ||
type: 'pie', | ||
}, | ||
theme: { mode: this.themeMode, palette: 'palette3' }, | ||
}, | ||
series: [] | ||
} | ||
}, | ||
watch: { | ||
selectedMonth() { | ||
this.getDeviceGraphData(); | ||
series: [], | ||
} | ||
}, | ||
selectedYear() { | ||
this.getDeviceGraphData(); | ||
watch: { | ||
selectedMonth() { | ||
this.getDeviceGraphData() | ||
}, | ||
selectedYear() { | ||
this.getDeviceGraphData() | ||
}, | ||
selectedPodcast() { | ||
this.getDeviceGraphData() | ||
}, | ||
}, | ||
selectedPodcast() { | ||
this.getDeviceGraphData(); | ||
} | ||
}, | ||
methods: { | ||
getDeviceGraphData() { | ||
this.$api | ||
.get(`podcaster/stats/graph/devices/${this.selectedPodcast}/${this.selectedYear}/${this.selectedMonth}`) | ||
.then((response) => { | ||
if (!response) { | ||
return | ||
} | ||
methods: { | ||
getDeviceGraphData() { | ||
this.$api | ||
.get(`podcaster/stats/graph/devices/${this.selectedPodcast}/${this.selectedYear}/${this.selectedMonth}`) | ||
.then((response) => { | ||
if (!response) { | ||
return | ||
} | ||
const devices = [] | ||
const labels = [] | ||
const devices = [] | ||
const labels = [] | ||
response.data.forEach(device => { | ||
devices.push(100/response.total * device.downloads) | ||
labels.push(device.device) | ||
}) | ||
response.data.forEach((device) => { | ||
devices.push((100 / response.total) * device.downloads) | ||
labels.push(device.device) | ||
}) | ||
this.series = devices | ||
this.options = {...this.options, ...{labels: labels}} | ||
}) | ||
this.series = devices | ||
this.options = { ...this.options, ...{ labels: labels } } | ||
}) | ||
}, | ||
}, | ||
created() { | ||
this.getDeviceGraphData() | ||
}, | ||
}, | ||
created() { | ||
this.getDeviceGraphData(); | ||
}, | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,70 @@ | ||
<template> | ||
<section class="k-modified-section podcaster"> | ||
<apexchart height="300" type="bar" :options="options" :series="series"></apexchart> | ||
</section> | ||
<section class="k-modified-section podcaster podcaster-graph"> | ||
<apexchart height="300" type="bar" :options="options" :series="series"></apexchart> | ||
</section> | ||
</template> | ||
<script> | ||
import VueApexCharts from 'vue-apexcharts' | ||
export default { | ||
components: {'apexchart': VueApexCharts}, | ||
props: { | ||
selectedMonth: Number, | ||
selectedYear: Number, | ||
selectedPodcast: String, | ||
}, | ||
data() { | ||
return { | ||
options: { | ||
chart: { | ||
id: 'downloads-month' | ||
components: { apexchart: VueApexCharts }, | ||
props: { | ||
selectedMonth: Number, | ||
selectedYear: Number, | ||
selectedPodcast: String, | ||
themeMode: String, | ||
}, | ||
data() { | ||
return { | ||
options: { | ||
chart: { | ||
id: 'downloads-month', | ||
}, | ||
yaxis: { | ||
labels: { | ||
formatter: function (val) { | ||
return val.toFixed(0) | ||
}, | ||
}, | ||
}, | ||
theme: { | ||
mode: this.themeMode, | ||
palette: 'palette3', | ||
}, | ||
xaxis: { | ||
categories: [ | ||
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, | ||
27, 28, 29, 30, 31, | ||
], | ||
}, | ||
}, | ||
series: [], | ||
} | ||
}, | ||
watch: { | ||
selectedMonth() { | ||
this.getEpisodeGraphData() | ||
}, | ||
yaxis: { | ||
labels: { | ||
formatter: function (val) { | ||
return val.toFixed(0); | ||
} | ||
} | ||
selectedYear() { | ||
this.getEpisodeGraphData() | ||
}, | ||
theme: { | ||
palette: 'palette3' | ||
selectedPodcast() { | ||
this.getEpisodeGraphData() | ||
}, | ||
xaxis: { | ||
categories: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31] | ||
} | ||
}, | ||
series: [] | ||
} | ||
}, | ||
watch: { | ||
selectedMonth() { | ||
this.getEpisodeGraphData(); | ||
}, | ||
selectedYear() { | ||
this.getEpisodeGraphData(); | ||
methods: { | ||
getEpisodeGraphData() { | ||
this.$api | ||
.get( | ||
`podcaster/stats/graph/downloads/${this.selectedPodcast}/${this.selectedYear}/${this.selectedMonth}` | ||
) | ||
.then((response) => { | ||
this.series = [{ name: 'downloads', data: response.days.slice(1) }] | ||
}) | ||
}, | ||
}, | ||
selectedPodcast() { | ||
this.getEpisodeGraphData(); | ||
} | ||
}, | ||
methods: { | ||
getEpisodeGraphData() { | ||
this.$api | ||
.get(`podcaster/stats/graph/downloads/${this.selectedPodcast}/${this.selectedYear}/${this.selectedMonth}`) | ||
.then((response) => { | ||
this.series = [{name: 'downloads', data: response.days.slice(1)}] | ||
}) | ||
created() { | ||
this.getEpisodeGraphData() | ||
}, | ||
}, | ||
created() { | ||
this.getEpisodeGraphData(); | ||
}, | ||
} | ||
</script> |
Oops, something went wrong.