# Vue Data UI > VueDataUI is a Vue 3 data visualization library providing numerous chart components (pie/donut, bar, line, radar, etc.), as well as tables and rating components. This guide offers ready-to-use examples and best practices for integrating VueDataUI into your Vue application. The content is optimized for AI code editors (GitHub Copilot, Cursor, etc.) to suggest correct usage patterns. Important notes: - This library is *not* compatible with Vue2. It is to be used with Vue3. - **Import and CSS:** Always import the required VueDataUI component and ensure you include the library's CSS. - **Reactive Data:** Use Vue's reactivity (`ref` or `computed`) to manage your `dataset` and `config` objects. - **Component Customization:** Use the config object to customize appearance (colors, legends, chart dimensions, etc.) based on your specific needs. - **AI Integration:** With these clear examples, AI code editors should suggest correct imports, prop bindings, and data structures, making it easier to build interactive charts with VueDataUI. ## Docs - [README](https://github.com/graphieros/vue-data-ui/blob/master/README.md): Readme file of the vue-data-ui library - [Documentation]https://vue-data-ui.graphieros.com/: Official documentation website for the vue-data-ui library ## Getting Started with VueDataUI To begin, install the library and include its stylesheet: pnpm add vue-data-ui In your main entry file (e.g., main.js or main.ts), import the CSS and optionally register components globally: import { createApp } from 'vue'; import App from './App.vue'; import 'vue-data-ui/style.css'; // Include VueDataUI styles // Example: register a component globally (optional) import { VueUiXy } from 'vue-data-ui'; const app = createApp(App); app.component('VueUiXy', VueUiXy); app.mount('#app'); You can also import components locally within Vue single-file components (see examples below). VueDataUI offers a **universal component** `` that can load any chart dynamically. For example: Using `VueDataUi` will lazy-load only the specified chart component. ## XY Chart Example with a Tree-Shaken Import Import a chart directly from its component entry point to avoid importing the full library entry. Use `vue-data-ui/vue-ui-xy` for the XY chart; other charts use the same pattern, for example `vue-data-ui/vue-ui-donut`. Both default and named component imports are supported. Keep the stylesheet import so the chart renders correctly. For line (or area) charts, bar chart, or combined charts, use the `VueUiXy` component. The dataset is an array of data points with the following datastructure: type VueUiXyDatasetItem = { name: string; series: number[]; type: "bar" | "line" | "plot"; color?: string; dashed?: boolean; useTag?: "start" | "end" | "none"; showSerieName?: "start" | "end"; useArea?: boolean; dataLabels?: boolean; useProgression?: boolean; // Display a trend line scaleSteps?: number; // The preferred number of scale segments on the y axis scaleLabel?: string; scaleMax?: number; // Force the max scale value scaleMin?: number; // Force the min scale value autoScaling?: boolean; stackRatio?: number; // In stacked mode, sets the height ratio of the datapoint comments?: string[]; // Provide an array of comments which will display at same index as the series item shape?: Shape; // circle, triangle, square, pentagon, hexagon, star smooth?: boolean; // Display as a spline prefix?: string; // Use a prefix on data labels suffix?: string; // Use a suffix on data labels } ## Sparkline Chart Example Sparkline charts are mini charts for showing trends. The `VueUiSparkline` component renders a small, minimalist line chart. The dataset is an array of data points with the following datastructure: type VueUiSparklineDatasetItem = { period: string // For example, a date value: number } Notes: - Ideal for embedding in dashboards or tables to indicate trends.