# Candlestick Chart

Animated financial charts for open, high, low, and close data.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown variants are available by appending `.md` to any URL or sending an `Accept: text/markdown` header. An agent skill is available at [/.well-known/agent-skills/site-skill.md](/.well-known/agent-skills/site-skill.md).





<ComponentPreview base="pixijs" title="Basic Chart" name="candlestick-chart-demo">
  <CandlestickChart />
</ComponentPreview>

## Installation [#installation]

<CodeTabs>
  <TabsList>
    <TabsTrigger value="cli">
      Command
    </TabsTrigger>

    <TabsTrigger value="manual">
      Manual
    </TabsTrigger>
  </TabsList>

  <TabsContent value="cli">
    ```bash
    npx shadcn@latest add @chartcn/pixijs/candlestick-chart
    ```
  </TabsContent>

  <TabsContent value="manual">
    <Steps>
      <Step>
        Install the following dependencies:
      </Step>

      ```bash
      npm install pixi.js
      ```

      <Step>
        Copy and paste the following code into your project.
      </Step>

      <ComponentSource src="registry/bases/pixijs/ui/chart.tsx" title="components/chart/pixijs/chart.tsx" />

      <ComponentSource src="registry/bases/pixijs/components/financial-chart/financial-chart.tsx" title="components/chart/pixijs/financial-chart.tsx" />

      <ComponentSource src="registry/bases/pixijs/components/candlestick-chart/candlestick-chart.tsx" title="components/chart/pixijs/candlestick-chart.tsx" />

      <Step>
        Update the import paths to match your project setup.
      </Step>
    </Steps>
  </TabsContent>
</CodeTabs>

## Usage [#usage]

```tsx
import { ChartcnCandlestickChart } from "@/components/chart/pixijs/candlestick-chart";
```

```tsx
<ChartcnCandlestickChart config={chartConfig} data={data}>
  <ChartcnCandlestickChart.Grid />
  <ChartcnCandlestickChart.XAxis />
  <ChartcnCandlestickChart.YAxis />
  <ChartcnCandlestickChart.Legend />
  <ChartcnCandlestickChart.Tooltip />
  <ChartcnCandlestickChart.Candlestick barWidth="58%" />
</ChartcnCandlestickChart>
```

## Examples [#examples]

### Hollow candles [#hollow-candles]

<ComponentPreview base="pixijs" title="style='hollow'" name="hollow-candlestick-chart-demo">
  <HollowCandlestickChart />
</ComponentPreview>

## API Reference [#api-reference]

### Candlestick [#candlestick]

| Prop       | Type                    | Default     |
| ---------- | ----------------------- | ----------- |
| `barWidth` | `number \| string`      | `"58%"`     |
| `style`    | `"classic" \| "hollow"` | `"classic"` |
