Getting Started
Charts
- Charts
- Line Chart
- Bar Chart
- Area Chart
- Scatter Chart
- Pie Chart
- Donut Chart
- Dot Plot Chart
- Lollipop Chart
- Dumbbell Chart
- Slope Chart
- Range Chart
- Histogram Chart
- Box Plot Chart
- Violin Chart
- Polar Chart
- Parallel Coordinates
- SPLOM Chart
- Parcats Chart
- Candlestick Chart
- OHLC Chart
- Waterfall Chart
- Funnel Chart
- Heatmap Chart
- Contour Chart
- Density Chart
- Ternary Chart
- Radar Chart
- Treemap Chart
- Sunburst Chart
- Sankey Chart
- Gauge Chart
- Bullet Chart
- Icicle Chart
- Network Graph
- Dendrogram
- Choropleth Chart
Economy
Midsize
Performance
"use client"
import { ParallelCoordinates } from "@/components/ui/charts/statistical/parallel-coordinates"
const carData = [
{
id: "Model A",
values: {
mpg: 32,
cylinders: 4,
horsepower: 110,
weight: 2500,
acceleration: 17,
},
group: "Economy",
},
{
id: "Model B",
values: {
mpg: 28,
cylinders: 6,
horsepower: 150,
weight: 3200,
acceleration: 14,
},
group: "Midsize",
},
{
id: "Model C",
values: {
mpg: 18,
cylinders: 8,
horsepower: 280,
weight: 4000,
acceleration: 11,
},
group: "Performance",
},
{
id: "Model D",
values: {
mpg: 35,
cylinders: 4,
horsepower: 95,
weight: 2300,
acceleration: 18,
},
group: "Economy",
},
{
id: "Model E",
values: {
mpg: 25,
cylinders: 6,
horsepower: 175,
weight: 3400,
acceleration: 13,
},
group: "Midsize",
},
{
id: "Model F",
values: {
mpg: 15,
cylinders: 8,
horsepower: 320,
weight: 4200,
acceleration: 10,
},
group: "Performance",
},
{
id: "Model G",
values: {
mpg: 30,
cylinders: 4,
horsepower: 125,
weight: 2700,
acceleration: 16,
},
group: "Economy",
},
{
id: "Model H",
values: {
mpg: 22,
cylinders: 6,
horsepower: 200,
weight: 3600,
acceleration: 12,
},
group: "Midsize",
},
]
const dimensions = ["mpg", "cylinders", "horsepower", "weight", "acceleration"]
export function ParallelCoordinatesDemo() {
return (
<ParallelCoordinates
data={carData}
dimensions={dimensions}
showLabels
showValues
lineOpacity={0.6}
/>
)
}
About
Parallel Coordinates is a powerful technique for visualizing high-dimensional data. Each dimension is represented as a vertical axis, and data points are drawn as polylines connecting values across axes. Great for identifying patterns, clusters, and outliers in multivariate datasets.
Installation
pnpm dlx shadcn@latest add https://ui.simplifyingai.com/r/parallel-coordinates.json
Usage
import { ParallelCoordinates } from "@/components/ui/charts"
const data = [
{ id: "Item 1", values: { a: 10, b: 25, c: 15 }, group: "A" },
{ id: "Item 2", values: { a: 22, b: 18, c: 30 }, group: "B" },
]
const dimensions = ["a", "b", "c"]
export function Example() {
return <ParallelCoordinates data={data} dimensions={dimensions} />
}Examples
Default (Standard)
Standard parallel coordinates with straight lines.
Economy
Midsize
Performance
"use client"
import { ParallelCoordinates } from "@/components/ui/charts/statistical/parallel-coordinates"
const carData = [
{
id: "Model A",
values: {
mpg: 32,
cylinders: 4,
horsepower: 110,
weight: 2500,
acceleration: 17,
},
group: "Economy",
},
{
id: "Model B",
values: {
mpg: 28,
cylinders: 6,
horsepower: 150,
weight: 3200,
acceleration: 14,
},
group: "Midsize",
},
{
id: "Model C",
values: {
mpg: 18,
cylinders: 8,
horsepower: 280,
weight: 4000,
acceleration: 11,
},
group: "Performance",
},
{
id: "Model D",
values: {
mpg: 35,
cylinders: 4,
horsepower: 95,
weight: 2300,
acceleration: 18,
},
group: "Economy",
},
{
id: "Model E",
values: {
mpg: 25,
cylinders: 6,
horsepower: 175,
weight: 3400,
acceleration: 13,
},
group: "Midsize",
},
{
id: "Model F",
values: {
mpg: 15,
cylinders: 8,
horsepower: 320,
weight: 4200,
acceleration: 10,
},
group: "Performance",
},
{
id: "Model G",
values: {
mpg: 30,
cylinders: 4,
horsepower: 125,
weight: 2700,
acceleration: 16,
},
group: "Economy",
},
{
id: "Model H",
values: {
mpg: 22,
cylinders: 6,
horsepower: 200,
weight: 3600,
acceleration: 12,
},
group: "Midsize",
},
]
const dimensions = ["mpg", "cylinders", "horsepower", "weight", "acceleration"]
export function ParallelCoordinatesDemo() {
return (
<ParallelCoordinates
data={carData}
dimensions={dimensions}
showLabels
showValues
lineOpacity={0.6}
/>
)
}
Curved Lines
Smooth curved lines for a softer visual appearance.
"use client"
import { ParallelCoordinates } from "@/components/ui/charts/statistical/parallel-coordinates"
// Iris dataset style - measurements of flowers
const flowerData = [
{
id: "Sample 1",
values: {
sepalLength: 5.1,
sepalWidth: 3.5,
petalLength: 1.4,
petalWidth: 0.2,
},
},
{
id: "Sample 2",
values: {
sepalLength: 4.9,
sepalWidth: 3.0,
petalLength: 1.4,
petalWidth: 0.2,
},
},
{
id: "Sample 3",
values: {
sepalLength: 7.0,
sepalWidth: 3.2,
petalLength: 4.7,
petalWidth: 1.4,
},
},
{
id: "Sample 4",
values: {
sepalLength: 6.4,
sepalWidth: 3.2,
petalLength: 4.5,
petalWidth: 1.5,
},
},
{
id: "Sample 5",
values: {
sepalLength: 6.3,
sepalWidth: 3.3,
petalLength: 6.0,
petalWidth: 2.5,
},
},
{
id: "Sample 6",
values: {
sepalLength: 5.8,
sepalWidth: 2.7,
petalLength: 5.1,
petalWidth: 1.9,
},
},
{
id: "Sample 7",
values: {
sepalLength: 5.0,
sepalWidth: 3.4,
petalLength: 1.5,
petalWidth: 0.2,
},
},
{
id: "Sample 8",
values: {
sepalLength: 6.9,
sepalWidth: 3.1,
petalLength: 4.9,
petalWidth: 1.5,
},
},
]
const dimensions = ["sepalLength", "sepalWidth", "petalLength", "petalWidth"]
export function ParallelCoordinatesCurved() {
return (
<ParallelCoordinates
data={flowerData}
dimensions={dimensions}
variant="curved"
showLabels
showValues
color="#8b5cf6"
lineOpacity={0.5}
valueFormatter={(v) => v.toFixed(1)}
/>
)
}
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| data | ParallelCoordinatesDataPoint[] | required | Array of data points |
| dimensions | string[] | required | Dimension names to display |
| variant | "standard" | "curved" | "standard" | Line style |
| showLabels | boolean | true | Show dimension labels |
| showValues | boolean | true | Show tick values |
| lineOpacity | number | 0.5 | Line opacity (0-1) |
| color | string | - | Single color for all lines |
| colorScheme | string[] | blue palette | Colors for groups |
| valueFormatter | function | toFixed(0) | Format tick values |
Data Format
interface ParallelCoordinatesDataPoint {
id: string // Unique identifier
values: Record<string, number> // Dimension values
group?: string // Optional group for coloring
}Variants
Standard
Straight lines connecting values across axes. Default and most common style.
Curved
Smooth curved lines using monotone interpolation. Provides a softer visual appearance.
Features
- Hover interactions: Lines highlight on hover with tooltip showing all values
- Group coloring: Automatic color assignment based on data groups
- Single color mode: Use
colorprop for a consistent appearance - Interactive tooltips: See all dimension values on hover
- Dark mode support: Proper styling for both themes
Notes
- Parallel coordinates are excellent for visualizing multivariate data with 3 or more dimensions
- Each vertical axis represents a different dimension
- Lines that intersect frequently may indicate correlations between dimensions
- Adjust lineOpacity to better see overlapping patterns in dense datasets
- Groups are color-coded to help identify clusters and patterns
Ask Your Database Anything with ChatPlotDB
Connect your database, ask questions in plain English, and get answers as charts, tables, and dashboards. No SQL required.
Join the ChatPlotDB waitlist