chore: update model chart style

This commit is contained in:
Zhang Minghan 2024-01-24 23:55:07 +08:00
parent b179be80ea
commit 3332a1a1c0

View File

@ -32,6 +32,7 @@ function ModelChart({ labels, datasets, dark }: ModelChartProps) {
const text = dark ? "#fff" : "#000"; const text = dark ? "#fff" : "#000";
return { return {
responsive: true,
scales: { scales: {
x: { x: {
stacked: true, stacked: true,
@ -54,6 +55,7 @@ function ModelChart({ labels, datasets, dark }: ModelChartProps) {
display: false, display: false,
}, },
legend: { legend: {
position: "right",
display: true, display: true,
labels: { labels: {
color: text, color: text,
@ -79,7 +81,10 @@ function ModelChart({ labels, datasets, dark }: ModelChartProps) {
<Loader2 className={`h-4 w-4 inline-block animate-spin`} /> <Loader2 className={`h-4 w-4 inline-block animate-spin`} />
)} )}
</p> </p>
<Bar id={`model-chart`} data={data} options={options} /> {
//@ts-ignore
<Bar id={`model-chart`} data={data} options={options} />
}
</div> </div>
); );
} }