Merge pull request #2958 from JordyvanDortmont/2.4

Fix metrics fill theme color application
This commit is contained in:
James Brooks
2018-03-26 19:25:18 +01:00
committed by GitHub
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>