chartcn

MDX embedding

Insert the same registry chart into Fumadocs / MDX or RSC pages.

Pattern

  1. Install (or use the demo export) chart-area-stacked
  2. Register the client component in getMDXComponents
  3. Use the JSX tag in MDX
import { ChartAreaStacked } from "@/components/charts"

export function getMDXComponents(components) {
  return {
    ...defaultMdxComponents,
    ChartAreaStacked,
    ...components,
  }
}
## Mix over time

<ChartAreaStacked />

Live demo

Same registry item as json-render: chart-area-stacked

Area Chart — Stacked
Traffic by acquisition channel

This is the same registry item used in the json-render demo — server MDX and client dynamic trees share one source component.

On this page