Chart

Data visualization.

Basic

Use b-chart with chart-type or use specific chart such as b-bar-chart.

Bar chart

Line chart

Bubble chart

Donut chart

Pie chart

Polar area chart

Radar chart

Scatter chart

Custom chart

import { createTypedChart } from 'vue-chartjs'
import { LineController } from 'chart.js'

// The first argument is the chart-id, the second the chart type, third is the custom controller
const CustomLine = createTypedChart('custom-line', 'line', LineController)

Chart Attributes

AttributeDescriptionTypeAccepted ValuesDefault
chart-dataObject with Chart dataObjectRefopen in new window
chart-optionsObject with Chart optionsObjectRefopen in new window
dataset-id-keyIndex key in datasetString'label'
widthchart width, will ignore if options.responsive = true (default)Number400
heightchart height, will ignore if options.responsive = true (default)Number400
pluginsArray with Chart pluginsArrayRefopen in new window

Chart Events

Event NameDescriptionParameters
chart:renderedif the chart object instance rendered
chart:destroyedif the chart object instance removed
chart:updatedif the update handler performs an update instead of a re-render
labels:updatedif new labels were set

Chart Methods

MethodDescriptionParameters
createTypedChartGenerate a custom chart(chartId: string, chartType: string, chartController: ChartController)
Last Updated:
Contributors: Tam Mai