### Install nuxt-charts
Source: https://github.com/dennisadriaans/vue-chrts/blob/main/packages/nuxt/README.md
Install the nuxt-charts module using npm, yarn, or pnpm.
```bash
# npm
npm install nuxt-charts
# yarn
yarn add nuxt-charts
# pnpm
pnpm add nuxt-charts
```
--------------------------------
### Install nuxt-charts for Nuxt 3+
Source: https://context7.com/dennisadriaans/vue-chrts/llms.txt
Install the Nuxt module for zero-config integration into Nuxt 3+ applications.
```bash
npm install nuxt-charts
```
--------------------------------
### Installation
Source: https://context7.com/dennisadriaans/vue-chrts/llms.txt
Instructions for installing the vue-chrts package for Vue 3 and the nuxt-charts module for Nuxt 3+.
```bash
npm install vue-chrts
# or
pnpm add vue-chrts
# or
yarn add vue-chrts
```
```bash
npm install nuxt-charts
```
```typescript
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['nuxt-charts'],
// Optional module configuration
nuxtCharts: {
prefix: '', // Component name prefix (default: '')
global: true, // Register as global components (default: true)
autoImports: true, // Enable auto-imports (default: true)
include: [], // Specific components to include; empty = all (default: [])
},
});
```
--------------------------------
### Revenue & Costs with Profit Line Example
Source: https://github.com/dennisadriaans/vue-chrts/blob/main/packages/vue/lib/components/DualChart/README.md
An example demonstrating how to display monthly revenue and costs as grouped bars with profit as a trend line, including legend positioning.
```APIDOC
## Example: Revenue & Costs with Profit Line
### Description
Shows monthly revenue and costs as grouped bars with profit as a trend line. This example also demonstrates how to set the legend position.
### Component Usage
```vue
```
```
--------------------------------
### Install Vue-chrts for Vue.js
Source: https://github.com/dennisadriaans/vue-chrts/blob/main/packages/vue/README.md
Install the vue-chrts package using npm, yarn, or pnpm. Import chart components as needed.
```bash
# npm
npm install vue-chrts
# yarn
yarn add vue-chrts
# pnpm
pnpm add vue-chrts
# import component
import { LineChart } from 'vue-chrts';
```
--------------------------------
### Install vue-chrts for Vue 3
Source: https://context7.com/dennisadriaans/vue-chrts/llms.txt
Install the core Vue 3 chart component library using npm, pnpm, or yarn.
```bash
npm install vue-chrts
# or
pnpm add vue-chrts
# or
yarn add vue-chrts
```
--------------------------------
### Vue-chrts Usage Example
Source: https://github.com/dennisadriaans/vue-chrts/blob/main/packages/vue/README.md
Demonstrates how to use the LineChart component with sample data, categories, and formatters. Ensure data and categories are properly structured.
```vue
```
--------------------------------
### Revenue & Costs with Profit Line Example
Source: https://github.com/dennisadriaans/vue-chrts/blob/main/packages/vue/lib/components/DualChart/README.md
Configures the DualChart to display monthly revenue and costs as grouped bars, with profit shown as a trend line. This example is useful for comparing absolute values (bars) against a trend (line).
```vue
```
--------------------------------
### Install Vue-chrts for Nuxt.js
Source: https://github.com/dennisadriaans/vue-chrts/blob/main/packages/vue/README.md
Install the nuxt-charts package using npm, yarn, or pnpm. Add the module to your nuxt.config.ts file.
```bash
# npm
npm install nuxt-charts
# yarn
yarn add nuxt-charts
# pnpm
pnpm add nuxt-charts
# Add module to your nuxt.config.ts
export default defineNuxtConfig({
modules: ["nuxt-charts"]
});
```
--------------------------------
### Basic DualChart Usage
Source: https://github.com/dennisadriaans/vue-chrts/blob/main/packages/vue/lib/components/DualChart/README.md
Demonstrates the basic setup for the DualChart component, including data definition, bar and line category configuration, and axis mapping. This is useful for creating a dual-axis chart with bars and lines.
```vue
```
--------------------------------
### LineChart Component Example
Source: https://context7.com/dennisadriaans/vue-chrts/llms.txt
Renders a multi-series line chart with customizable data, categories, formatting, and visual properties. Ensure data and categories are properly typed.
```vue
```
--------------------------------
### Use LineChart Component in Nuxt
Source: https://github.com/dennisadriaans/vue-chrts/blob/main/packages/nuxt/README.md
Example of using the LineChart component within a Nuxt application. Requires importing the component and providing data, categories, and formatting options.
```vue
```
--------------------------------
### Stacked Bars with Line Chart
Source: https://github.com/dennisadriaans/vue-chrts/blob/main/packages/vue/lib/components/DualChart/README.md
This setup visualizes stacked bars representing composition, with a trend line overlaid. It's useful for showing parts of a whole alongside a performance trend.
```vue
```
--------------------------------
### Import LineChart Component in Vue 3
Source: https://context7.com/dennisadriaans/vue-chrts/llms.txt
Demonstrates how to import a specific chart component directly into a Vue 3 project. Ensure you have vue-chrts installed.
```javascript
import { LineChart } from 'vue-chrts'
```
--------------------------------
### Vue GanttChart Component
Source: https://context7.com/dennisadriaans/vue-chrts/llms.txt
Implement this component for timeline or Gantt charts. It displays horizontal bars grouped by rows, with customizable start, duration, and category mapping for coloring. Labels can be shown or hidden.
```vue
```
--------------------------------
### DualChart Component Usage
Source: https://github.com/dennisadriaans/vue-chrts/blob/main/packages/vue/lib/components/DualChart/README.md
Demonstrates the basic usage of the DualChart component with sample data and configuration for bar and line series.
```APIDOC
## DualChart Component
### Description
Combines bar and line charts to display multiple data series with different visualizations. Ideal for comparing metrics like actuals vs. targets, revenue with profit trends, or any scenario where you need to visualize data using different chart types simultaneously.
### Props
#### Required Props
- `data` (T[]): Array of data points to display.
- `barCategories` (Record): Configuration for bar series (name and color).
- `lineCategories` (Record): Configuration for line series (name and color).
- `barYAxis` ((keyof T)[]): Array of property keys for bar chart values.
- `lineYAxis` ((keyof T)[]): Array of property keys for line chart values.
- `height` (number): Chart height in pixels.
#### Optional Props
- `xLabel` (string): Label for x-axis.
- `yLabel` (string): Label for y-axis.
- `yLabelSecondary` (string): Label for secondary y-axis (if needed).
- `padding` ({ top, right, bottom, left }): Chart padding. Defaults to `{ top: 5, right: 5, bottom: 5, left: 5 }`.
- `xFormatter` (axisFormatter): Function to format x-axis tick labels.
- `yFormatter` (axisFormatter): Function to format y-axis tick labels.
- `tooltipTitleFormatter` ((data: T) => string | number): Custom tooltip title formatter.
- `curveType` (CurveType): Line curve type. Defaults to `MonotoneX`.
- `lineWidth` (number): Width of line in pixels. Defaults to `2`.
- `stacked` (boolean): Whether to stack bars. Defaults to `false`.
- `groupPadding` (number): Padding between bar groups. Defaults to `0`.
- `barPadding` (number): Padding between bars (0-1). Defaults to `0.2`.
- `radius` (number): Rounded corner radius for bars. Defaults to `0`.
- `orientation` (Orientation): Bar orientation. Defaults to `Vertical`.
- `legendPosition` (LegendPosition): Legend position. Defaults to `BottomCenter`.
- `hideLegend` (boolean): Hide legend. Defaults to `false`.
- `hideTooltip` (boolean): Hide tooltip. Defaults to `false`.
- `yGridLine` (boolean): Show y-axis grid lines. Defaults to `true`.
- `xGridLine` (boolean): Show x-axis grid lines. Defaults to `false`.
- `yDomainLine` (boolean): Show y-axis domain line. Defaults to `false`.
- `xDomainLine` (boolean): Show x-axis domain line. Defaults to `false`.
- `yTickLine` (boolean): Show y-axis tick lines. Defaults to `false`.
- `xTickLine` (boolean): Show x-axis tick lines. Defaults to `false`.
- `hideXAxis` (boolean): Hide x-axis. Defaults to `false`.
- `hideYAxis` (boolean): Hide y-axis. Defaults to `false`.
- `xNumTicks` (number): Number of x-axis ticks.
- `yNumTicks` (number): Number of y-axis ticks.
- `minMaxTicksOnly` (boolean): Show only min and max ticks. Defaults to `false`.
- `xExplicitTicks` ((number | string | Date)[]): Explicit x-axis tick values.
### Example Usage
```vue
```
```
--------------------------------
### Dagre Graph Configuration
Source: https://context7.com/dennisadriaans/vue-chrts/llms.txt
Sets up nodes and links for a directed acyclic graph and configures layout, styling, and interactivity using Dagre.
```vue
```
--------------------------------
### TooltipConfig Interface
Source: https://context7.com/dennisadriaans/vue-chrts/llms.txt
Configures tooltip behavior, such as delays for showing/hiding and whether the tooltip should follow the cursor.
```ts
interface TooltipConfig {
hideDelay?: number; // ms before tooltip hides (default: undefined)
showDelay?: number; // ms before tooltip shows (default: undefined)
followCursor?: boolean; // Tooltip follows cursor
}
```
--------------------------------
### Compute Map Data and Snap Coordinates
Source: https://context7.com/dennisadriaans/vue-chrts/llms.txt
Utilize getMap to generate a dot-grid MapData object from GeoJSON, optionally filtering by countries or bounding box. Use getPin to convert lat/lng coordinates to the nearest grid dot.
```ts
import { getMap, getPin } from 'vue-chrts';
import countriesGeoJson from './countries.geo.json';
// Compute dot grid for Europe
const map = getMap({
height: 80,
countries: ['FRA', 'DEU', 'ESP', 'ITA', 'GBR'],
grid: 'vertical',
geojsonWorld: countriesGeoJson,
});
// map.points — Record of dot positions keyed as "x;y"
// map.width, map.height — final grid dimensions
// Snap Paris to nearest dot
const parisPin = getPin(map, { lat: 48.85, lng: 2.35 });
// => { x: 42, y: 18, lat: 48.846, lng: 2.352 }
```
--------------------------------
### TopoJSON Map Configuration
Source: https://context7.com/dennisadriaans/vue-chrts/llms.txt
Renders a geographic map using TopoJSON data, defining areas and points with specific styling and interactivity.
```vue
```
--------------------------------
### Sales vs Target Bar and Line Chart
Source: https://github.com/dennisadriaans/vue-chrts/blob/main/packages/vue/lib/components/DualChart/README.md
Use this configuration to display quarterly sales as bars against a target line. Ensure your data is structured to provide both sales and target values.
```vue
```
--------------------------------
### Available TopoJSON Datasets
Source: https://context7.com/dennisadriaans/vue-chrts/llms.txt
Imports various pre-bundled TopoJSON datasets for different geographic regions from the vue-chrts library.
```typescript
import {
USATopoJSON,
USCountiesTopoJSON,
WorldMapTopoJSON,
WorldMap110mAlphaTopoJSON,
WorldMapSimplestTopoJSON,
ChinaTopoJSON,
FranceTopoJSON,
GermanyTopoJSON,
IndiaTopoJSON,
UKTopoJSON,
} from 'vue-chrts';
```
--------------------------------
### AxisConfig Interface
Source: https://context7.com/dennisadriaans/vue-chrts/llms.txt
Provides fine-tuning options for chart axes, including tick lines, text styling, formatting, and alignment.
```ts
interface AxisConfig {
tickLine?: boolean;
tickTextFontSize?: string;
tickTextColor?: string;
tickFormat?: axisFormatter;
tickTextAlign?: 'left' | 'right' | 'center';
tickTextAngle?: number;
tickTextWidth?: number;
tickTextFitMode?: 'wrap' | 'trim';
minMaxTicksOnly?: boolean;
tickValues?: readonly number[] | readonly Date[];
}
```
--------------------------------
### Vue DonutChart for Pie and Donut Visualizations
Source: https://context7.com/dennisadriaans/vue-chrts/llms.txt
DonutChart creates full or half donut/pie charts. Data is a `number[]` mapped by `categories`. Customize arc width, padding, and tooltips.
```vue
```
--------------------------------
### Single Bar with Multiple Lines Chart
Source: https://github.com/dennisadriaans/vue-chrts/blob/main/packages/vue/lib/components/DualChart/README.md
Configure the chart to show a single bar series with multiple trend lines for comparison. This is effective for comparing a primary metric against several benchmarks or forecasts.
```vue
```
--------------------------------
### Configure nuxt-charts module
Source: https://context7.com/dennisadriaans/vue-chrts/llms.txt
Configure the nuxt-charts module in your nuxt.config.ts file to customize component registration and imports.
```typescript
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['nuxt-charts'],
// Optional module configuration
nuxtCharts: {
prefix: '', // Component name prefix (default: '')
global: true, // Register as global components (default: true)
autoImports: true, // Enable auto-imports (default: true)
include: [], // Specific components to include; empty = all (default: [])
},
});
```
--------------------------------
### Add nuxt-charts to Nuxt Config
Source: https://github.com/dennisadriaans/vue-chrts/blob/main/packages/nuxt/README.md
Add the nuxt-charts module to your Nuxt configuration file to enable its features.
```typescript
// nuxt.config.ts
export default defineNuxtConfig({
modules: ["nuxt-charts"]
});
```
--------------------------------
### Orientation Enum for Bar Charts
Source: https://context7.com/dennisadriaans/vue-chrts/llms.txt
Defines orientation options for bar charts. Import and use to switch between vertical and horizontal layouts.
```typescript
import { Orientation } from 'vue-chrts';
// Orientation.Vertical | Orientation.Horizontal
```
--------------------------------
### Custom Tooltip Slot for DualChart
Source: https://github.com/dennisadriaans/vue-chrts/blob/main/packages/vue/lib/components/DualChart/README.md
Customize the chart's tooltip display using the `#tooltip` slot. This allows for rich, formatted information to be shown when hovering over data points.
```vue
{{ values.month }}
Revenue: ${{ values.revenue?.toLocaleString() }}
Profit: ${{ values.profit?.toLocaleString() }}
```
--------------------------------
### Sankey Chart Configuration
Source: https://context7.com/dennisadriaans/vue-chrts/llms.txt
Defines nodes and links for a Sankey diagram and configures its appearance and behavior using accessor functions.
```vue
```
--------------------------------
### Render SVG Dot-Grid Map with Pins
Source: https://context7.com/dennisadriaans/vue-chrts/llms.txt
Use the DottedMap component to display a world or region map with customizable pins. Configure map dimensions, dot appearance, grid layout, background color, and country-specific colors.
```vue
```
--------------------------------
### BulletLegendItemInterface Definition
Source: https://context7.com/dennisadriaans/vue-chrts/llms.txt
Defines the structure for a category legend item, including display label, color, and visibility options.
```ts
interface BulletLegendItemInterface {
name: string | number; // Display label
color?: string | string[]; // Color or gradient stops
className?: string;
inactive?: boolean; // Grayed-out state
hidden?: boolean; // Remove from legend
pointer?: boolean; // Show pointer cursor
}
```
--------------------------------
### LegendPosition Enum for Chart Legends
Source: https://context7.com/dennisadriaans/vue-chrts/llms.txt
Specifies available placement options for chart legends. Import and use to control legend position.
```typescript
import { LegendPosition } from 'vue-chrts';
// LegendPosition.TopLeft | TopCenter | TopRight
// LegendPosition.BottomLeft | BottomCenter | BottomRight
```
--------------------------------
### MarkerConfig for Line/Area Charts
Source: https://context7.com/dennisadriaans/vue-chrts/llms.txt
Defines SVG line-end markers for area or line charts, specifying marker type, size, and color for different series.
```ts
type MarkerConfig = {
id: string;
config: {
[key: string]: {
type?: 'circle' | 'square' | 'triangle' | 'diamond';
size?: number;
strokeWidth?: number;
color?: string;
strokeColor?: string;
};
};
};
// Example: place a circle marker at each series endpoint
const markerConfig: MarkerConfig = {
id: 'sales-marker',
config: {
revenue: { type: 'circle', size: 10, color: '#3b82f6', strokeColor: '#fff', strokeWidth: 2 },
profit: { type: 'diamond', size: 10, color: '#10b981', strokeColor: '#fff', strokeWidth: 2 },
},
};
//
```
--------------------------------
### DualChart Click Event Handling
Source: https://github.com/dennisadriaans/vue-chrts/blob/main/packages/vue/lib/components/DualChart/README.md
Handle chart click events to retrieve associated data values. The `@click` event emits the event object and the specific data values at the clicked point.
```vue
console.log('Clicked:', values)"
/>
```
--------------------------------
### Vue BarChart for Grouped and Stacked Data
Source: https://context7.com/dennisadriaans/vue-chrts/llms.txt
BarChart supports grouped, stacked, stacked-grouped, and horizontal layouts. Control rounded corners with `radius`, padding with `barPadding`/`groupPadding`, and orientation.
```vue
```
--------------------------------
### Vue AreaChart with Gradient Fills
Source: https://context7.com/dennisadriaans/vue-chrts/llms.txt
Use AreaChart for overlaid or stacked area modes. Customize opacity gradients with `gradientStops`. Set `hideArea` to true for a line-only chart.
```vue
```
--------------------------------
### TypeScript Generics for DualChart Props
Source: https://github.com/dennisadriaans/vue-chrts/blob/main/packages/vue/lib/components/DualChart/README.md
Leverage TypeScript generics for type-safe data handling with the DualChart component. This ensures props are correctly typed, improving development safety and autocompletion.
```typescript
import { DualChart } from 'vue-charts';
import type { DualChartProps } from 'vue-charts';
type MyDataType = {
month: string;
value1: number;
value2: number;
};
// Props will be type-checked
const props: DualChartProps = {
data: myData,
barCategories: { value1: { name: 'Value 1', color: '#000' } },
lineCategories: { value2: { name: 'Value 2', color: '#fff' } },
barYAxis: ['value1'],
lineYAxis: ['value2'],
height: 300,
};
```
--------------------------------
### CurveType Enum for Line Charts
Source: https://context7.com/dennisadriaans/vue-chrts/llms.txt
Defines available line interpolation modes for area and line charts. Import and use in your template for custom line rendering.
```typescript
import { CurveType } from 'vue-chrts';
// Available values:
// CurveType.Linear | CurveType.MonotoneX | CurveType.CatmullRom
// CurveType.Basis | CurveType.Step | CurveType.StepAfter | CurveType.StepBefore
// CurveType.Natural | CurveType.Cardinal | CurveType.Bundle | ...
// Usage in a template:
//
```
--------------------------------
### Vue DualChart Component
Source: https://context7.com/dennisadriaans/vue-chrts/llms.txt
Use this component to combine bar and line charts with independent y-axes. Define separate categories for bars and lines, and specify which data fields map to each axis. Useful for comparing different metrics over the same x-axis.
```vue
```
--------------------------------
### Vue BubbleChart Component
Source: https://context7.com/dennisadriaans/vue-chrts/llms.txt
Use this component for scatter/bubble charts where data points are colored by category and sized by a numeric accessor. Ensure data, categories, and accessors are correctly defined.
```vue
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.