Vue UI Components Documentation
The Vue Chart draws more than 30 chart types, among them line, area, bar, pie, donut, range, financial, polar and spider charts, as SVG or HTML5 Canvas. This guide adds the Vue Chart (jqxChart) to an app, then shows how to set its options, handle its events and call its methods.
jqwidgets-scriptsjqwidgets-scripts/jqwidgets-vue3/vue_jqxchart.vue 
In a Vue 3 project (to start one, see Getting started with Vue), add the package:
npm install jqwidgets-scripts
import JqxChart from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxchart.vue';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.tailwind-blue-dark.css';
With <script setup>, an imported component is ready to use in the template. jqx.base.css is required; the second file is a theme, selected with the theme attribute.
The Column Series with Local Data demo as a Single-File Component:
<template>
<JqxChart
style="width: 850px; height: 500px"
:title="'Fitness & exercise weekly scorecard'"
:description="'Time spent in vigorous exercise'"
:showLegend="true"
:enableAnimations="true"
:padding="padding"
:titlePadding="titlePadding"
:source="sampleData"
:xAxis="xAxis"
:seriesGroups="seriesGroups"
:colorScheme="'scheme01'"
>
</JqxChart>
</template>
<script setup>
import { ref } from 'vue';
import JqxChart from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxchart.vue';
const sampleData = ref([
{ Day: 'Monday', Keith: 30, Erica: 15, George: 25 },
{ Day: 'Tuesday', Keith: 25, Erica: 25, George: 30 },
{ Day: 'Wednesday', Keith: 30, Erica: 20, George: 25 },
{ Day: 'Thursday', Keith: 35, Erica: 25, George: 45 },
{ Day: 'Friday', Keith: 20, Erica: 20, George: 25 },
{ Day: 'Saturday', Keith: 30, Erica: 20, George: 30 },
{ Day: 'Sunday', Keith: 60, Erica: 45, George: 90 }
]);
const padding = ref({ left: 5, top: 5, right: 5, bottom: 5 });
const titlePadding = ref({ left: 90, top: 0, right: 0, bottom: 10 });
const xAxis = ref({ dataField: 'Day', showGridLines: true });
const seriesGroups = ref([
{
type: 'column',
columnsGapPercent: 50,
seriesGapPercent: 0,
valueAxis: {
unitInterval: 10,
minValue: 0,
maxValue: 100,
displayValueAxis: true,
description: 'Time in minutes',
axisSize: 'auto',
tickMarksColor: '#888888'
},
series: [
{ dataField: 'Keith', displayText: 'Keith' },
{ dataField: 'Erica', displayText: 'Erica' },
{ dataField: 'George', displayText: 'George' }
]
}
]);
</script>
<style></style>
Options are attributes. Bind values from the script with :, for example :width="850".
Listen to an event with @ and its name. For example, click: The event is raised when the user clicks on series element.
<script setup>
function onClick(event) {
console.log(event.args);
}
</script>
<template>
<JqxChart @click="onClick" />
</template>
Call methods through a template ref. For example, refresh:
<script setup>
import { ref, onMounted } from 'vue';
const myChart = ref(null);
onMounted(() => {
myChart.value.refresh();
});
</script>
<template>
<JqxChart ref="myChart" />
</template>
Every component also has setOptions({ … }) and getOptions('name').