syncfusion-react-linear-gauge
Implement Syncfusion React Linear Gauge for displaying measurements on a linear scale. Use this skill when users need temperature sensors, KPI indicators, progress gauges, or real-time monitoring dashboards. Covers axes configuration, pointer types, ranges, annotations, customization, animations, print/export, accessibility, and internationalization.
What this skill does
# Implementing Syncfusion React Linear Gauge
## When to Use This Skill
Use the Linear Gauge component when you need to:
- **Display measurements** on a linear/horizontal scale (temperature gauges, thermometers, fuel indicators)
- **Monitor real-time data** with animated pointer updates (sensor readings, system metrics)
- **Show progress or percentages** in a linear format
- **Create dashboards** with multiple gauges displaying KPIs
- **Visualize ranges** with different colors (e.g., safe, warning, critical zones)
- **Build responsive data visualizations** with customizable appearance and interactivity
- **Print or export gauge visualizations** for reports and documentation
The Linear Gauge is ideal for applications requiring visual representation of values on a horizontal/linear scale with customizable axes, pointers, ranges, and interactive features.
---
## Component Overview
**Syncfusion React Linear Gauge** (`@syncfusion/ej2-react-lineargauge`) is a data visualization component that displays values on a linear scale. It consists of:
- **Axes** - The linear scale with customizable range, ticks, labels, and styling
- **Pointers** - Value indicators in two types: Bar (default) or Marker (shapes)
- **Ranges** - Colored segments representing value ranges (e.g., cold, warm, hot)
- **Annotations** - Text or image overlays for labels and callouts
- **Ticks & Labels** - Scale markers with customizable formatting
- **Export** - Print, PDF, PNG, or SVG export capabilities
---
## Documentation and Navigation Guide
Choose the reference based on what you need to implement:
### Getting Started & Setup
๐ **Read:** [references/getting-started.md](references/getting-started.md)
- Install `@syncfusion/ej2-react-lineargauge` package
- Setup in Vite or Create React App
- Basic component initialization
- Minimal working example
- CSS imports and themes
- **When to read:** First time setup or new project integration
### Gauge Structure: Axes, Ticks & Labels
๐ **Read:** [references/axis-ticks-labels.md](references/axis-ticks-labels.md)
- Configure axes (minimum, maximum range)
- Customize axis line (height, width, color)
- Configure major and minor ticks
- Format and customize labels
- Set label units and formatting
- Multiple axes configuration
- **When to read:** Building the core gauge structure and scale
### Pointer Types & Configuration
๐ **Read:** [references/pointers.md](references/pointers.md)
- Bar pointer type (default, fill styles)
- Marker pointer types (Circle, Rectangle, Triangle, Diamond, Image, Text)
- Setting and updating pointer values
- Customize pointer appearance (width, color, radius)
- Multiple pointers on same axis
- Drag-drop interactions
- Performance optimization
- **When to read:** Adding value indicators and interactive features
### Ranges & Annotations
๐ **Read:** [references/ranges-annotations.md](references/ranges-annotations.md)
- Creating ranges with start/end values
- Range styling (colors, gradient effects)
- Range labels and positions
- Text annotations for callouts and labels
- Image annotations
- Positioning and alignment
- **When to read:** Highlighting value zones or adding descriptive elements
### Visual Appearance & Customization
๐ **Read:** [references/appearance-customization.md](references/appearance-customization.md)
- Add titles
- Set gauge dimensions (width, height, margin)
- Customize background and borders
- Apply themes and color schemes
- Responsive design patterns
- CSS class customization
- RTL language support
- **When to read:** Styling and customizing gauge appearance
### Advanced Features
๐ **Read:** [references/advanced-features.md](references/advanced-features.md)
- Animation effects and timing
- Event handling (valueChange, print, export)
- Tooltips and hover effects
- Print and export to PDF/PNG/SVG
- Real-time data binding and updates
- Combining multiple features
- Performance tips and optimization
- **When to read:** Adding interactions, animations, or export functionality
## Quick Start Example
Here's a minimal working example to get started:
```tsx
import React from 'react';
import { LinearGaugeComponent, AxesDirective, AxisDirective,
PointersDirective, PointerDirective, RangesDirective, RangeDirective }
from '@syncfusion/ej2-react-lineargauge';
import '@syncfusion/ej2-lineargauge/styles/material.css';
export function App() {
return (
<div style={{ height: '400px', width: '100%' }}>
<LinearGaugeComponent
title="Temperature Monitor"
orientation="Horizontal"
>
<AxesDirective>
<AxisDirective
minimum={0}
maximum={100}
labelStyle={{ format: '{value}ยฐC' }}
>
<RangesDirective>
<RangeDirective start={0} end={30} color='#1E90FF' />
<RangeDirective start={30} end={70} color='#FFA500' />
<RangeDirective start={70} end={100} color='#FF4500' />
</RangesDirective>
<PointersDirective>
<PointerDirective value={55} />
</PointersDirective>
</AxisDirective>
</AxesDirective>
</LinearGaugeComponent>
</div>
);
}
```
Install the package first:
```bash
npm install @syncfusion/ej2-react-lineargauge --save
```
---
## Common Patterns
### Pattern 1: Simple Temperature Gauge
```tsx
<LinearGaugeComponent title="Temperature">
<AxesDirective>
<AxisDirective minimum={-40} maximum={50} labelStyle={{ format: '{value}ยฐC' }}>
<RangesDirective>
<RangeDirective start={-40} end={0} color='#4CAF50' />
<RangeDirective start={0} end={25} color='#8BC34A' />
<RangeDirective start={25} end={50} color='#FF5722' />
</RangesDirective>
<PointersDirective>
<PointerDirective value={20} />
</PointersDirective>
</AxisDirective>
</AxesDirective>
</LinearGaugeComponent>
```
### Pattern 2: Progress/Percentage Indicator
```tsx
<PointersDirective>
<PointerDirective
value={75}
type='Marker'
markerType='Rectangle'
width={20}
color='#007AFF'
/>
</PointersDirective>
```
### Pattern 3: Real-Time Updates
```tsx
const [value, setValue] = useState(50);
useEffect(() => {
const timer = setInterval(() => {
setValue(prev => (prev + (Math.random() - 0.5) * 10) % 100);
}, 1000);
return () => clearInterval(timer);
}, []);
<PointerDirective value={value} />
```
---
## LinearGaugeComponent API Reference
### **Verified Props (Based on Official Syncfusion Documentation)**
| Prop | Type | Purpose | Example |
|------|------|---------|---------|
| `title` | string | Gauge title text | `title="Temperature"` |
| `orientation` | "Horizontal" \| "Vertical" | Layout orientation (default: Vertical) | `orientation="Horizontal"` |
| `width` | string | Gauge width | `width="100%"` or `width="400px"` |
| `height` | string | Gauge height | `height="300px"` |
---
## AxisDirective API Reference
### **Verified Props for AxisDirective**
| Prop | Type | Purpose | Example |
|------|------|---------|---------|
| `minimum` | number | Start value of the axis range | `minimum={0}` |
| `maximum` | number | End value of the axis range | `maximum={200}` |
| `labelStyle` | object | Label customization (use `format` property) | `labelStyle={{ format: '{value}ยฐC' }}` |
### **labelStyle Format Options**
- `{ format: '{value}' }` - Shows value as-is
- `{ format: '{value}ยฐC' }` - Adds ยฐC suffix
- `{ format: '${value}K' }` - Adds $ prefix and K suffix
- `{ format: '{value}%' }` - Adds % suffix
**โ ๏ธ NOT SUPPORTED:**
- โ `majorTicksInterval` - Not a valid property
- โ `minorTicksInterval` - Not a valid property
- โ `axisLineStyle` - Not a valid property (use axis-level styling instead)
---
## PointerDirective API Reference
### **Verified Props for PointerDirective**
| Prop | Type | Purpose | Example |
|------|------|---------|---------|
| `value` | number | The value to display | `value={140}` |
| `color` | Related in Web Dev
generating-lwc-components
IncludedLightning Web Components with PICKLES methodology and 165-point scoring. Use this skill when the user creates or edits LWC components, builds wire service patterns, or writes Jest tests for LWC. TRIGGER when: user creates/edits LWC components, touches lwc/**/*.js, .html, .css, .js-meta.xml files, or asks about wire service, SLDS, or Jest LWC tests. DO NOT TRIGGER when: Apex classes (use generating-apex), Aura components, or Visualforce.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Set up queries with useQuery, mutations with useMutation, configure QueryClient caching strategies, implement optimistic updates, and handle infinite scroll with useInfiniteQuery. Use when: setting up data fetching in React projects, migrating from v4 to v5, or fixing object syntax required errors, query callbacks removed issues, cacheTime renamed to gcTime, isPending vs isLoading confusion, keepPreviousData removed problems.
document-processor-api
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
nutrient-document-processing
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Covers useMutationState, simplified optimistic updates, throwOnError, network mode (offline/PWA), and infiniteQueryOptions. Use when setting up data fetching, fixing v4โv5 migration errors (object syntax, gcTime, isPending, keepPreviousData), or debugging SSR/hydration issues with streaming server components.
accelint-nextjs-best-practices
IncludedNext.js performance optimization and best practices. Use when writing Next.js code (App Router or Pages Router); implementing Server Components, Server Actions, or API routes; optimizing RSC serialization, data fetching, or server-side rendering; reviewing Next.js code for performance issues; fixing authentication in Server Actions; or implementing Suspense boundaries, parallel data fetching, or request deduplication.