Fix metrics fill theme color application #2797

This commit is contained in:
Jordy van Dortmont
2018-03-24 16:33:38 +01:00
parent 0fcd939f50
commit c66048d977
4 changed files with 31 additions and 28 deletions

40
public/dist/js/all.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -42,6 +42,9 @@ Chart.defaults.global.legend.display = false
module.exports = {
props: [
'metric',
'theme',
'theme-light',
'theme-dark'
],
data () {
return {
@@ -137,12 +140,12 @@ module.exports = {
labels: data_keys,
datasets: [{
data: _.values(this.data),
// backgroundColor: "{{ $theme_metrics }}",
// borderColor: "{{ color_darken($theme_metrics, -0.1) }}",
// pointBackgroundColor: "{{ color_darken($theme_metrics, -0.1) }}",
// pointBorderColor: "{{ color_darken($theme_metrics, -0.1) }}",
// pointHoverBackgroundColor: "{{ color_darken($theme_metrics, -0.2) }}",
// pointHoverBorderColor: "{{ color_darken($theme_metrics, -0.2) }}"
backgroundColor: this.themeLight,
borderColor: this.theme,
pointBackgroundColor: this.theme,
pointBorderColor: this.theme,
pointHoverBackgroundColor: this.themeDark,
pointHoverBorderColor: this.themeDark
}]
},
options: {

View File

@@ -4,7 +4,7 @@
<ul class="list-group">
@foreach($metrics as $metric)
<li class="list-group-item metric" data-metric-id="{{ $metric->id }}">
<metric-chart :metric="{{ $metric->toJson() }}"></metric-chart>
<metric-chart :metric="{{ $metric->toJson() }}" :theme-light="{{ json_encode($theme_metrics) }}" :theme="{{ json_encode(color_darken($theme_metrics, -0.1)) }}" :theme-dark="{{ json_encode(color_darken($theme_metrics, -0.2)) }}"></metric-chart>
</li>
@endforeach
</ul>