Skip to content

A platform for community discussion. Free, open, simple.

UX: Styling update to line chart (#37894)

chapoied59d66e989b
diff --git a/frontend/discourse/admin/components/admin-report-chart.gjs b/frontend/discourse/admin/components/admin-report-chart.gjs
index c18fb05ba89..8060a3e3ef8 100644
--- a/frontend/discourse/admin/components/admin-report-chart.gjs
+++ b/frontend/discourse/admin/components/admin-report-chart.gjs
@@ -80,10 +80,15 @@ export default class AdminReportChart extends Component {
: model.secondary_color,
borderColor: model.primary_color,
pointRadius: 3,
- borderWidth: 1,
+ borderWidth: 2,
pointBackgroundColor: pointColors,
pointBorderColor: pointColors,
+ pointStyle: "rectRounded",
+ borderCapStyle: "round",
+ borderJoinStyle: "round",
segment,
+ tension: 0.4,
+ fill: "origin",
},
],
};
@@ -96,6 +101,7 @@ export default class AdminReportChart extends Component {
backgroundColor: "transparent",
borderWidth: 1,
pointRadius: 0,
+ fill: false,
});
}
@@ -105,6 +111,18 @@ export default class AdminReportChart extends Component {
options: {
plugins: {
tooltip: {
+ backgroundColor: getCSSColor("--primary"),
+ titleMarginBottom: 16,
+ footerMarginTop: 16,
+ padding: {
+ left: 20,
+ right: 20,
+ top: 12,
+ bottom: 12,
+ },
+ bodySpacing: 8,
+ cornerRadius: 8,
+ boxPadding: 4,
callbacks: {
title: (tooltipItem) =>
moment(tooltipItem[0].parsed.x).format("LL"),
@@ -128,9 +146,9 @@ export default class AdminReportChart extends Component {
},
responsive: true,
maintainAspectRatio: false,
- responsiveAnimationDuration: 0,
+ responsiveAnimationDuration: 300,
animation: {
- duration: 0,
+ duration: 300,
},
layout: {
padding: {
@@ -143,11 +161,12 @@ export default class AdminReportChart extends Component {
scales: {
y: {
display: true,
+ grid: { color: getCSSColor("--primary-low") },
ticks: {
callback: (label) => number(label),
sampleSize: 5,
- maxRotation: 25,
- minRotation: 25,
+ minRotation: 0,
+ precision: 0,
},
},
x: {
@@ -160,7 +179,7 @@ export default class AdminReportChart extends Component {
ticks: {
sampleSize: 5,
maxRotation: 50,
- minRotation: 50,
+ minRotation: 0,
},
},
},