Skip to content

Commit

Permalink
fix: adjust status chart.
Browse files Browse the repository at this point in the history
  • Loading branch information
jxlpzqc committed Apr 23, 2024
1 parent e559d91 commit 4c9c96f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion pages/src/components/StatusChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type Props = {
export default function StatusChart({ data }: Props) {

const config: BarConfig = {
data,
data: data.filter(x => x.status !== 'proofreading'),
xField: 'desc',
yField: 'count',
colorField: 'desc',
Expand All @@ -20,6 +20,13 @@ export default function StatusChart({ data }: Props) {
},
axis: {
y: false,
x: {
tick: false,
line: false,
labelAutoHide: false,
labelFontSize: 16,
labelSpacing: 16,
}
},
theme: 'academy',
tooltip: (k: CountItem) => k.count,
Expand Down
2 changes: 1 addition & 1 deletion pages/src/utils/getStatusCount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export type CountItem = {
const getStatusCount = (posts: CollectionEntry<"posts">[]) => {
return STATUS_LIST.map(u => ({
status: u.status,
desc: u.text,
desc: u.tabText,
count: posts.filter(x => x.data.status === u.status).length
})) as CountItem[];
};
Expand Down

0 comments on commit 4c9c96f

Please sign in to comment.