Complete guide to VibeCharts - The advanced charting library
v1.1.0VibeCharts is a modern, lightweight JavaScript library for creating beautiful, interactive charts. With zero dependencies and support for 17+ chart types, it's the perfect solution for any data visualization project.
Zero dependencies. Pure JavaScript with optimized performance.
Individual element colors, gradients, themes, and unlimited styling options.
Automatically adapts to any screen size with touch support.
Download the files and include them in your HTML:
<!-- Include CSS -->
<link rel="stylesheet" href="assets/css/VibeCharts.css">
<!-- Include JavaScript -->
<script src="assets/js/VibeCharts.js"></script>
npm install vibecharts
<link rel="stylesheet" href="https://cdn.vibecharts.com/v1.1.0/VibeCharts.css">
<script src="https://cdn.vibecharts.com/v1.1.0/VibeCharts.js"></script>
Now you can assign different colors to each bar, line point, or chart element:
const chart = new VibeCharts('myChart', {
type: 'bar',
barColorMode: 'individual', // Each bar gets a different color
colors: ['#667eea', '#764ba2', '#f093fb', '#4facfe']
});
Automatic color variations from a base color:
const chart = new VibeCharts('myChart', {
type: 'bar',
barColorMode: 'shade', // Creates lighter/darker shades
colors: ['#667eea'] // Base color
});
Theme-aware shimmer animations while charts load:
const chart = new VibeCharts('myChart', {
showPlaceholder: true // Shows animated placeholder
});
// Load data asynchronously
await chart.loadData('https://api.example.com/data');
VibeCharts supports 17+ chart types for all your data visualization needs:
type: 'bar'
Vertical bars for comparing categories
type: 'horizontalBar'
Horizontal bars for rankings
type: 'line'
Trends and changes over time
type: 'area'
Filled line chart with gradient
type: 'pie'
Proportions and percentages
type: 'donut'
Pie with center total display
type: 'radar'
Multi-dimensional comparison
type: 'gauge'
Single KPI display
type: 'heatmap'
Matrix data with color intensity
type: 'waterfall'
Cumulative value changes
Control how colors are applied to bar charts:
// Option 1: Series Mode (all bars same color)
barColorMode: 'series'
// Option 2: Individual Mode (each bar different color)
barColorMode: 'individual'
// Option 3: Shade Mode (auto-generate shades)
barColorMode: 'shade'
Control how colors are applied to line charts:
// Option 1: Same Color (traditional line chart)
lineColorMode: 'same'
// Option 2: Individual (each point different color)
lineColorMode: 'individual'
// Option 3: Gradient (smooth color transition)
lineColorMode: 'gradient'
Comprehensive configuration options for complete customization:
| Option | Type | Default | Description |
|---|---|---|---|
type |
String | 'bar' | Chart type |
data |
Array | [] | Chart data |
barColorMode ⭐ |
String | 'series' | 'series', 'individual', 'shade' |
lineColorMode ⭐ |
String | 'same' | 'same', 'individual', 'gradient' |
colors |
Array | ['#667eea', ...] | Color palette |
theme |
String | 'dark' | 'lite', 'dark', 'gradient', 'glass' |
style |
String | 'default' | 'sharp', 'default', 'soft', 'rounded' |
gradient |
Boolean | false | Enable gradient fills |
showPlaceholder ⭐ |
Boolean | true | Show loading placeholder |
responsive |
Boolean | true | Auto-resize on container change |
showGrid |
Boolean | true | Display grid lines |
showLegend |
Boolean | true | Display legend |
title |
String | '' | Chart title |
height |
Number | 400 | Chart height in pixels |
theme: 'dark'
Modern dark background for contemporary apps
theme: 'lite'
Clean white background for bright interfaces
theme: 'gradient'
Purple gradient for stunning visuals
theme: 'glass'
Glassmorphism with blur effect
new VibeCharts('myChart', {
type: 'bar',
customTheme: {
backgroundColor: '#0f0f1a',
textColor: '#e4e4e7',
gridColor: '#2a2a3e'
}
});
style: 'sharp' // 0px radius
style: 'default' // 4px radius
style: 'soft' // 18px radius
style: 'rounded' // 51px radius
const chart = new VibeCharts('myChart', {
type: 'bar',
data: [
{ label: 'Product A', value: 150 },
{ label: 'Product B', value: 230 },
{ label: 'Product C', value: 180 }
]
});
const chart = new VibeCharts('myChart', {
type: 'line',
showPlaceholder: true // Shows loading animation
});
// Load data asynchronously
await chart.loadData('https://api.example.com/data.json');
// Update chart with new data
chart.updateOptions({
data: newDataArray,
colors: ['#ff0000', '#00ff00']
});
new VibeCharts(containerId, options)
Parameters:
containerId (String) - ID of DOM elementoptions (Object) - Configuration objectLoad data from object or URL:
// From object
chart.loadData([{ label: 'A', value: 10 }]);
// From URL
await chart.loadData('https://api.example.com/data.json');
Update chart configuration:
chart.updateOptions({
theme: 'dark',
colors: ['#ff0000'],
data: newData
});
Manually re-render chart:
chart.render();
Clean up and remove chart:
chart.destroy();
const chart = new VibeCharts('myChart', {
type: 'bar',
data: [
{ label: 'Q1', value: 45000 },
{ label: 'Q2', value: 62000 },
{ label: 'Q3', value: 58000 },
{ label: 'Q4', value: 73000 }
],
theme: 'dark',
style: 'soft',
barColorMode: 'individual',
colors: ['#667eea', '#764ba2', '#f093fb', '#4facfe']
});
const chart = new VibeCharts('lineChart', {
type: 'line',
data: [
{ label: 'Week 1', value: 30 },
{ label: 'Week 2', value: 45 },
{ label: 'Week 3', value: 55 },
{ label: 'Week 4', value: 70 }
],
lineColorMode: 'gradient',
colors: ['#4facfe', '#00f2fe'],
theme: 'dark'
});
const chart = new VibeCharts('donutChart', {
type: 'donut',
data: [
{ label: 'Desktop', value: 45 },
{ label: 'Mobile', value: 35 },
{ label: 'Tablet', value: 20 }
],
theme: 'gradient',
style: 'soft'
});
// Good: Meaningful palette
colors: ['#2ecc71', '#e74c3c', '#3498db']
// Avoid: Too many colors
colors: ['#abc', '#def', '#123', ...] // 20+ colors
showPlaceholder for async data