Skip to content

Chart ​

Beautiful charts. Built using Vis/Unovis.

Examples ​

Default ​

vue
<script setup>
import { VisXYContainer, VisLine, VisAxis } from '@unovis/vue'

const data = [
  { x: 1, y: 1 },
  { x: 2, y: 3 },
  { x: 3, y: 2 }
]
</script>

<template>
  <ClientOnly>
    <VisXYContainer :data="data">
      <VisLine :x="d => d.x" :y="d => d.y" />
      <VisAxis type="x" />
      <VisAxis type="y" />
    </VisXYContainer>
  </ClientOnly>
</template>

Installation ​

bash
pnpm add @unovis/vue @unovis/ts
bash
npm install @unovis/vue @unovis/ts
bash
yarn add @unovis/vue @unovis/ts
bash
bun add @unovis/vue @unovis/ts

Props ​

VisXYContainer ​

PropTypeDefaultDescription
dataDataRecord[]-The data to render
heightnumber-The height of the container
widthnumber-The width of the container
marginMargin-The margin of the container

VisLine ​

PropTypeDefaultDescription
xNumericAccessor-The x-axis accessor
yNumericAccessor-The y-axis accessor
colorColorAccessor-The color accessor

Slots ​

VisXYContainer ​

SlotDescription
defaultThe chart components