Chart style updates

This commit is contained in:
Qstick
2023-09-03 11:58:24 -05:00
parent b608e38454
commit 0f160707d3
5 changed files with 33 additions and 4 deletions

View File

@@ -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

View File

@@ -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'

View File

@@ -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
}
} }
} }
}, },

View File

@@ -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>

View File

@@ -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",