コンテンツにスキップ
アカウントを作成
または
サインイン
Stripe ドキュメントのロゴ
/
AI に質問する
アカウントを作成
サインイン
始める
支払い
売上
プラットフォームおよびマーケットプレイス
資金管理
Developer resources
概要
バージョン管理
変更ログ
API バージョンのアップグレード
SDK バージョンをアップグレードする
ツール
SDK
API
テスト
ワークベンチ
イベントの送信先
ワークフロー
Stripe CLI
Stripe Shell
開発者ダッシュボード
エージェントツールキット
LLM を使用した構築Visual Studio Code をご利用の場合Stripe 健全性アラートファイルのアップロード
セキュリティとプライバシー
セキュリティ
プライバシー
Stripe を拡張する
Stripe Apps
    概要
    始める
    アプリを作成する
    Stripe アプリの仕組み
    サンプルアプリ
    アプリを構築する
    シークレットを保存
    API 認証方法
    認証フロー
    サーバー側のロジック
    イベントのリッスン
    さまざまな環境を処理
    サンドボックスのサポートを有効にする
    アプリの設定ページ
    UI を構築する
    アカウント登録
    アプリを配布する
    配布オプション
    アプリをアップロード
    バージョンとリリース
    アプリをテストする
    アプリを公開する
    自分のアプリを宣伝する
    ディープリンクを追加する
    インストールリンクを作成
    UI 拡張機能で役割を割り当て
    インストール後のアクション
    アプリのアナリティクス
    アプリの埋め込みコンポーネント
    サードパーティーの Stripe アプリを埋め込む
    Stripe Apps に移行
    拡張機能を移行または構築
    Stripe Apps または Stripe Connect にプラグインを移行
    参照情報
    アプリマニフェスト
    CLI
    拡張 SDK
    権限
    ビューポート
    設計パターン
    コンポーネント
      アコーディオン
      バッジ
      バナー
      BarChart
      ボックス
      ボタン
      ButtonGroup
      チェックボックス
      チップ
      ContextView
      DateField
      ディバイダー
      FocusView
      FormFieldGroup
      アイコン
      Img
      インライン
      LineChart
      Link
      リスト
      メニュー
      PropertyList
      ラジオ
      選択してください
      SettingsView
      SignInView
      Sparkline
      スピナー
      切り替える
      テーブル
      タブ
      タスクリスト
      テキスト領域
      テキストフィールド
      トースト
      ツールチップ
Stripe のコネクター
パートナー
Partner Ecosystem
パートナー認定
ホームDeveloper resourcesStripe AppsComponents

注

このページはまだ日本語ではご利用いただけません。より多くの言語で文書が閲覧できるように現在取り組んでいます。準備が整い次第、翻訳版を提供いたしますので、もう少しお待ちください。

Stripe Apps の BarChart コンポーネント

棒グラフは、棒を使用してデータを一連のデータポイントとして視覚化します。

ページをコピー

BarChart コンポーネントをアプリに追加するには、以下のようにします。

import {BarChart} from '@stripe/ui-extension-sdk/ui';

BarChart コンポーネントのプレビューを以下に示します。

サンプルを読み込み中...
const sales = [ { date: 'Jan', sold: 1, }, { date: 'Feb', sold: 4, }, { date: 'Mar', sold: 2, }, { date: 'Apr', sold: 3, }, ]; return ( <Box css={{width: 'fill'}}> <BarChart data={sales} x="date" y="sold" /> </Box> )

BarChart props

プロパティータイプ

data

必須

{ [x: string]: any; }[]

The data used to generate the chart.

x

必須

string | number | Channel

The property or accessor for the point on the x axis.

Related types: Channel.

y

必須

string | number | Channel

The property or accessor for the point on the y axis.

Related types: Channel.

axis

オプション

("x" | "y" | "both" | "none") | undefined

Determines whether to render labels and ticks for each axis.

color

オプション

(string | number | Channel) | undefined

Groups data by color based on a property or accessor.

Related types: Channel.

grid

オプション

("x" | "y" | "both" | "none") | undefined

Determines whether to render grid lines for each axis.

legend

オプション

boolean | undefined

Determines whether to render the legend (when more than one item is present).

tooltip

オプション

boolean | undefined

Determines whether to render a tooltip when hovering over the chart.

z

オプション

(string | number | Channel) | undefined

Groups data based on a property or accessor.

Related types: Channel.

Channel

プロパティータイプ

domain

オプション

any[] | undefined

format

オプション

((Currency | UnitIdentifier) | ("capitalize" | { [x: string]: string; })) | undefined

Related types: Currency, UnitIdentifier.

label

オプション

string | undefined

value

オプション

(string | number) | undefined

通貨

プロパティータイプ

currency

必須

'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BRL' | 'BSD' | 'BTN' | 'BWP' | 'BYN' | 'BZD' | 'CAD' | 'CDF' | 'CHF' | 'CLP' | 'CNY' | 'COP' | 'CRC' | 'CUC' | 'CUP' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ERN' | 'ETB' | 'EUR' | 'FJD' | 'FKP' | 'GBP' | 'GEL' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HRK' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRU' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLL' | 'SOS' | 'SRD' | 'SSP' | 'STN' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'USD' | 'UYU' | 'UZS' | 'VES' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XCD' | 'XOF' | 'XPF' | 'YER' | 'ZAR' | 'ZMW'

UnitIdentifier

プロパティータイプ

unit

必須

'acre' | 'bit' | 'byte' | 'celsius' | 'centimeter' | 'day' | 'degree' | 'fahrenheit' | 'fluid-ounce' | 'foot' | 'gallon' | 'gigabit' | 'gigabyte' | 'gram' | 'hectare' | 'hour' | 'inch' | 'kilobit' | 'kilobyte' | 'kilogram' | 'kilometer' | 'liter' | 'megabit' | 'megabyte' | 'meter' | 'mile' | 'mile-scandinavian' | 'milliliter' | 'millimeter' | 'millisecond' | 'minute' | 'month' | 'ounce' | 'percent' | 'petabyte' | 'pound' | 'second' | 'stone' | 'terabit' | 'terabyte' | 'week' | 'yard' | 'year' | `${'acre' | 'bit' | 'byte' | 'celsius' | 'centimeter' | 'day' | 'degree' | 'fahrenheit' | 'fluid-ounce' | 'foot' | 'gallon' | 'gigabit' | 'gigabyte' | 'gram' | 'hectare' | 'hour' | 'inch' | 'kilobit' | 'kilobyte' | 'kilogram' | 'kilometer' | 'liter' | 'megabit' | 'megabyte' | 'meter' | 'mile' | 'mile-scandinavian' | 'milliliter' | 'millimeter' | 'millisecond' | 'minute' | 'month' | 'ounce' | 'percent' | 'petabyte' | 'pound' | 'second' | 'stone' | 'terabit' | 'terabyte' | 'week' | 'yard' | 'year'}-per-${'acre' | 'bit' | 'byte' | 'celsius' | 'centimeter' | 'day' | 'degree' | 'fahrenheit' | 'fluid-ounce' | 'foot' | 'gallon' | 'gigabit' | 'gigabyte' | 'gram' | 'hectare' | 'hour' | 'inch' | 'kilobit' | 'kilobyte' | 'kilogram' | 'kilometer' | 'liter' | 'megabit' | 'megabyte' | 'meter' | 'mile' | 'mile-scandinavian' | 'milliliter' | 'millimeter' | 'millisecond' | 'minute' | 'month' | 'ounce' | 'percent' | 'petabyte' | 'pound' | 'second' | 'stone' | 'terabit' | 'terabyte' | 'week' | 'yard' | 'year'}`

色の使用

color チャネルは、データを次のようにグループ化します。

サンプルを読み込み中...
const sales = [ { date: 'Jan', sold: 1, product: 'tables', }, { date: 'Jan', sold: 2, product: 'chairs', }, { date: 'Feb', sold: 4, product: 'tables', }, { date: 'Feb', sold: 6, product: 'chairs', }, { date: 'Mar', sold: 2, product: 'tables', }, { date: 'Mar', sold: 4, product: 'chairs', }, { date: 'Apr', sold: 7, product: 'tables', }, { date: 'Apr', sold: 9, product: 'chairs', }, ]; return ( <Box css={{width: 'fill'}}> <BarChart data={sales} x="date" y="sold" color="product" /> </Box> )

軸と値の形式設定

axis 値に文字列を渡す代わりに、value、label、または format プロパティーが含まれたオブジェクトを渡すことで、より豊富な形式設定を追加できます。

プロパティタイプ

value

string | number

データセット内のプロパティー名。必須。

label

string

軸の表示テキスト。

format

object

サポートされている通貨コード ({currency: 'USD'} など) またはサポートされている単位 ({unit: 'minute'} など) のいずれかを使用して、数値の形式を指定します。{unit: 'megabyte-per-hour'} のように間に -per- を入れることで複合単位を作成することもできます。

サンプルを読み込み中...
<Box css={{width: 'fill'}}> <BarChart data={[ { date: 'January', sold: 10, }, { date: 'February', sold: 41, }, { date: 'March', sold: 22, }, { date: 'April', sold: 38, }, ]} x="date" y={{value: 'sold', label: 'Price', format: {currency: 'USD'}}} /> </Box>

ドメイン

軸の最小値と最大値を設定するには、domain プロパティーを使用します。たとえば、y 軸を (提供されたデータに合わせて自動調整するのではなく) 常に 0 から 10 の範囲にしたい場合は、設定に domain プロパティーを追加します。

サンプルを読み込み中...
const sales = [ { date: 'Jan', sold: 1, }, { date: 'Feb', sold: 4, }, { date: 'Mar', sold: 2, }, { date: 'Apr', sold: 3, }, ]; return ( <Box css={{width: 'fill'}}> <BarChart data={sales} x="date" y={{value: 'sold', label: 'Sold', domain: [0, 10]}} /> </Box> )

参照情報

  • 従うべき設計パターン
  • アプリのスタイル設定
  • UI テスト
このページはお役に立ちましたか。
はいいいえ
お困りのことがございましたら 、サポートにお問い合わせください。
早期アクセスプログラムにご参加ください。
変更ログをご覧ください。
ご不明な点がございましたら、お問い合わせください。
LLM ですか?llms.txt を読んでください。
Powered by Markdoc