Overview

Get a working chart by hand, or paste one prompt and let an agent render one.

Show code for

shell
npm install @chartkitdev/core @chartkitdev/react
tsx
import { Chart } from "@chartkitdev/react";

const spec = {
  version: "1",
  type: "line",
  data: [
    { week: "W1", signups: 18 },
    { week: "W2", signups: 42 },
  ],
  encoding: { x: "week", y: "signups" },
  a11y: { alt: "Signups rose from 18 to 42." },
};

export function Panel() {
  return <Chart spec={spec} />;
}
shell
npm install @chartkitdev/core @chartkitdev/vue
vue
<script setup>
import { Chart } from "@chartkitdev/vue";

const spec = {
  version: "1",
  type: "line",
  data: [
    { week: "W1", signups: 18 },
    { week: "W2", signups: 42 },
  ],
  encoding: { x: "week", y: "signups" },
  a11y: { alt: "Signups rose from 18 to 42." },
};
</script>

<template>
  <Chart :spec="spec" />
</template>
shell
npm install @chartkitdev/core @chartkitdev/svelte
svelte
<script>
  import { Chart } from "@chartkitdev/svelte";

  const spec = {
    version: "1",
    type: "line",
    data: [
      { week: "W1", signups: 18 },
      { week: "W2", signups: 42 },
    ],
    encoding: { x: "week", y: "signups" },
    a11y: { alt: "Signups rose from 18 to 42." },
  };
</script>

<Chart {spec} />
shell
npm install @chartkitdev/core @chartkitdev/astro
astro
---
import { Chart } from "@chartkitdev/astro";

const spec = {
  version: "1",
  type: "line",
  data: [
    { week: "W1", signups: 18 },
    { week: "W2", signups: 42 },
  ],
  encoding: { x: "week", y: "signups" },
  a11y: { alt: "Signups rose from 18 to 42." },
};
---

<Chart spec={spec} />
shell
npm install @chartkitdev/core @chartkitdev/solid
tsx
import { Chart } from "@chartkitdev/solid";

const spec = {
  version: "1",
  type: "line",
  data: [
    { week: "W1", signups: 18 },
    { week: "W2", signups: 42 },
  ],
  encoding: { x: "week", y: "signups" },
  a11y: { alt: "Signups rose from 18 to 42." },
};

export function Panel() {
  return <Chart spec={spec} />;
}
shell
npm install @chartkitdev/core @chartkitdev/qwik
tsx
import { component$ } from "@builder.io/qwik";
import { Chart } from "@chartkitdev/qwik";

const spec = {
  version: "1",
  type: "line",
  data: [
    { week: "W1", signups: 18 },
    { week: "W2", signups: 42 },
  ],
  encoding: { x: "week", y: "signups" },
  a11y: { alt: "Signups rose from 18 to 42." },
};

export const Panel = component$(() => {
  return <Chart spec={spec} />;
});
shell
npm install @chartkitdev/core @chartkitdev/angular
ts
import { Component } from "@angular/core";
import { Chart } from "@chartkitdev/angular";

const spec = {
  version: "1",
  type: "line",
  data: [
    { week: "W1", signups: 18 },
    { week: "W2", signups: 42 },
  ],
  encoding: { x: "week", y: "signups" },
  a11y: { alt: "Signups rose from 18 to 42." },
};

@Component({
  standalone: true,
  imports: [Chart],
  template: `<ck-chart [spec]="spec" />`,
})
export class Panel {
  spec = spec;
}
shell
npm install @chartkitdev/core @chartkitdev/vanilla
js
import { mount } from "@chartkitdev/vanilla";

const spec = {
  version: "1",
  type: "line",
  data: [
    { week: "W1", signups: 18 },
    { week: "W2", signups: 42 },
  ],
  encoding: { x: "week", y: "signups" },
  a11y: { alt: "Signups rose from 18 to 42." },
};

mount(document.querySelector("#chart"), spec);
shell
npm install @chartkitdev/core @chartkitdev/element
js
import "@chartkitdev/element";

const spec = {
  version: "1",
  type: "line",
  data: [
    { week: "W1", signups: 18 },
    { week: "W2", signups: 42 },
  ],
  encoding: { x: "week", y: "signups" },
  a11y: { alt: "Signups rose from 18 to 42." },
};

const chart = document.querySelector("chart-kit");
chart.spec = spec;

You should now see a chart.

Signups rose from 18 to 42.Signups rose from 18 to 42.1020304050W1W2

Next steps