Chart style updates

pull/1853/head
Qstick 1 year ago
parent b608e38454
commit 0f160707d3

@ -2,6 +2,7 @@ import Chart from 'chart.js/auto';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React, { Component } from 'react'; import React, { Component } from 'react';
import { kinds } from 'Helpers/Props'; import { kinds } from 'Helpers/Props';
import { defaultFontFamily } from 'Styles/Variables/fonts';
function getColors(kind) { function getColors(kind) {
@ -39,7 +40,15 @@ class BarChart extends Component {
plugins: { plugins: {
title: { title: {
display: true, display: true,
text: this.props.title align: 'start',
text: this.props.title,
padding: {
bottom: 30
},
font: {
size: 14,
family: defaultFontFamily
}
}, },
legend: { legend: {
display: this.props.legend display: this.props.legend

@ -1,6 +1,7 @@
import Chart from 'chart.js/auto'; import Chart from 'chart.js/auto';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React, { Component } from 'react'; import React, { Component } from 'react';
import { defaultFontFamily } from 'Styles/Variables/fonts';
function getColors(kind) { function getColors(kind) {
@ -22,7 +23,15 @@ class DoughnutChart extends Component {
plugins: { plugins: {
title: { title: {
display: true, display: true,
text: this.props.title align: 'start',
text: this.props.title,
padding: {
bottom: 30
},
font: {
size: 14,
family: defaultFontFamily
}
}, },
legend: { legend: {
position: 'bottom' position: 'bottom'

@ -1,6 +1,7 @@
import Chart from 'chart.js/auto'; import Chart from 'chart.js/auto';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React, { Component } from 'react'; import React, { Component } from 'react';
import { defaultFontFamily } from 'Styles/Variables/fonts';
function getColors(index) { function getColors(index) {
@ -36,7 +37,15 @@ class StackedBarChart extends Component {
plugins: { plugins: {
title: { title: {
display: true, display: true,
text: this.props.title align: 'start',
text: this.props.title,
padding: {
bottom: 30
},
font: {
size: 14,
family: defaultFontFamily
}
} }
} }
}, },

@ -233,6 +233,7 @@ function IndexerStats() {
<BarChart <BarChart
data={getAverageResponseTimeData(item.indexers)} data={getAverageResponseTimeData(item.indexers)}
title={translate('AverageResponseTimesMs')} title={translate('AverageResponseTimesMs')}
stepSize={100}
/> />
</div> </div>
</div> </div>
@ -241,6 +242,7 @@ function IndexerStats() {
<BarChart <BarChart
data={getFailureRateData(item.indexers)} data={getFailureRateData(item.indexers)}
title={translate('IndexerFailureRate')} title={translate('IndexerFailureRate')}
stepSize={0.1}
kind={kinds.WARNING} kind={kinds.WARNING}
/> />
</div> </div>

@ -79,7 +79,7 @@
"Author": "Author", "Author": "Author",
"Automatic": "Automatic", "Automatic": "Automatic",
"AutomaticSearch": "Automatic Search", "AutomaticSearch": "Automatic Search",
"AverageResponseTimesMs": "Average Response Times (Ms)", "AverageResponseTimesMs": "Average Indexer Response Times (ms)",
"Backup": "Backup", "Backup": "Backup",
"BackupFolderHelpText": "Relative paths will be under Prowlarr's AppData directory", "BackupFolderHelpText": "Relative paths will be under Prowlarr's AppData directory",
"BackupIntervalHelpText": "Interval between automatic backups", "BackupIntervalHelpText": "Interval between automatic backups",

Loading…
Cancel
Save