Skip to content
fandhe-frontendcore v0.4.3
GitHub

Bar Chart

fandhe-frontend-pre-styled-ui の charts(内包)mod が提供するスタイル済み Bar Chart 部品です。

関連 API: fandhe-frontend-pre-styled-ui API

Demo

ChartData(複数系列)+ LinearScale + SVG ノード木生成ヘルパーのみで組み立てる、外部依存ゼロのグループ棒グラフです。orientation で縦/横を切り替えます。イシュー #2082 で shadcn/ui Charts(bar)と突合し、角丸・値ラベル・積み上げ・強調表示・正負色分け・軸/グリッドの静的バリアントを追加しました。マウス追従ツールチップ・凡例トグル等の実行時インタラクションは別イシュー(#2086/#2132)のスコープです。

Vertical
JanFebMarApr
Horizontal
JanFebMarApr
Axes
JanFebMarApr050100150200
Labeled
120Jan200Feb150Mar80Apr
Inside label
120Jan200Feb150Mar80Apr
Mixed
JanFebMarApr
Stacked
JanFebMarApr
  • Series
Stacked 100%
JanFebMarApr0%20%40%60%80%100%
Active
JanFebMarApr
Negative
JanFebMarApr

Features

  • ChartData(複数系列)+ LinearScale + SVG ノード木生成ヘルパーのみで組み立てるグループ棒グラフ
  • orientation(vertical/horizontal)で棒の向きを切り替える
  • 軸線・グリッド・凡例・ツールチップは charts(共通 API)側の別部品

Anatomy

root
  bar
  category-label
  value-label
  inside-label

API Reference

Arguments

NameTypeDefaultDescription
orientationOrientationVerticalカテゴリ軸の向き(vertical: 棒が縦に伸びる / horizontal: 棒が横に伸びる)。
widthf64480.0viewBox の幅(px 相当)。
heightf64300.0viewBox の高さ(px 相当)。

Data Attributes

PartAttributeObserved Values
bardata-active(値なし)
bardata-index0, 1, 2, 3
bardata-negative(値なし)
bardata-seriesnet change, signups, visits
inside-labeldata-index0, 1, 2, 3
inside-labeldata-seriesvisits
value-labeldata-index0, 1, 2, 3
value-labeldata-seriesvisits

Examples

縦/横 orientation

同じデータを vertical/horizontal で描画します。

JanFebMarApr
JanFebMarApr