mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-27 23:16:58 -04:00
New: Move to CSS Variables for Colorings
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
import Chart from 'chart.js/auto';
|
||||
import PropTypes from 'prop-types';
|
||||
import React, { Component } from 'react';
|
||||
import colors from 'Styles/Variables/colors';
|
||||
|
||||
function getColors(index) {
|
||||
|
||||
const style = getComputedStyle(document.body);
|
||||
return style.getPropertyValue('--chartColorsDiversified').split(',')[index];
|
||||
}
|
||||
|
||||
class StackedBarChart extends Component {
|
||||
constructor(props) {
|
||||
@@ -41,7 +46,7 @@ class StackedBarChart extends Component {
|
||||
return {
|
||||
label: d.label,
|
||||
data: d.data,
|
||||
backgroundColor: colors.chartColorsDiversified[index]
|
||||
backgroundColor: getColors(index)
|
||||
};
|
||||
})
|
||||
}
|
||||
@@ -54,7 +59,7 @@ class StackedBarChart extends Component {
|
||||
return {
|
||||
label: d.label,
|
||||
data: d.data,
|
||||
backgroundColor: colors.chartColorsDiversified[index]
|
||||
backgroundColor: getColors(index)
|
||||
};
|
||||
});
|
||||
this.myChart.update();
|
||||
|
||||
Reference in New Issue
Block a user