style(usage): tune shared bar/pie charts for the usage views

- bar-chart: barMinWidth so hour-granularity bars stay visible with gaps.
- pie-chart: single legend-beside-pie layout, value (percent%) tooltip,
  2-decimal rounding for the Summary donut.
This commit is contained in:
michelia
2026-06-03 17:10:51 +08:00
committed by michela feng
parent 2407416e33
commit 9a4d77e869
2 changed files with 24 additions and 25 deletions
+5 -1
View File
@@ -100,7 +100,11 @@ const BarChart: React.FC<BarChartProps> = (props) => {
data: processedData,
type: 'bar',
barMaxWidth: 20,
barMinWidth: 8,
// Keep a small floor only — a large barMinWidth would force wide bars
// when there are many categories (e.g. hourly buckets), squeezing out
// the category gap so bars look fused. A low floor lets barCategoryGap
// win, so even dense hourly views keep visible gaps.
barMinWidth: 2,
barGap: '30%',
barCategoryGap: '50%',
...(stack === false || stack === undefined ? {} : { stack }),