/syncfusion-javascript:syncfusion-javascript-linear-gaugefrom Syncfusion JavaScript UI Controls
Create and customize Syncfusion TypeScript and JavaScript Linear Gauge components for displaying measurements and metrics. Use this skill when user needs to implement a linear gauge, display scalar values in a linear scale, create measurement interfaces, configure ranges and pointers, add annotations, handle user interactions, or customize gauge appearance. Covers installation, configuration, events, accessibility, printing, and internationalization.
Ships in Syncfusion JavaScript UI Controls. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The Syncfusion Essential JS 2 Linear Gauge visualizes measurements and metrics on a linear scale. It can display horizontal or vertical scales with axes, ranges, pointers, labels, annotations, tooltips, animations, and interactive pointer dragging.
Use this skill when working with the Syncfusion EJ2 Linear Gauge in pure TypeScript or JavaScript.
Typical use cases include:
setPointerValue() for live data and programmatic updates.Choose the reference that matches the task.
Read: references/api-reference.md
Use this reference when you need:
Read: references/getting-started.md
Use this reference for:
@syncfusion/ej2-lineargaugeLinearGaugeRead: references/axis-and-scales.md
Use this reference for:
Read: references/ranges-and-pointers.md
Use this reference for:
Read: [references/customization-nd-appearance.md
Use this reference for:
axisLabelRenderRead: references/interaction-and-events.md
Use this reference for:
gaugeMouseDowngaugeMouseMovegaugeMouseUpdragStartdragMovedragEndvalueChangeRead: references/advanced-features.md
Use this reference for:
Read: references/dimensions-and-responsive.md
Use this reference for:
ResizeObserverUse the pure TypeScript and JavaScript Linear Gauge package.
npm install @syncfusion/ej2-lineargauge
Import the Linear Gauge in TypeScript.
import { LinearGauge } from '@syncfusion/ej2-lineargauge';
For applications using the complete EJ2 global JavaScript bundle, initialize the component through:
ej.lineargauge.LinearGauge
Do not use Angular wrapper packages or Angular component modules in pure TypeScript and JavaScript examples.
// Do not use in pure TypeScript.
import {
LinearGaugeModule,
LinearGaugeAllModule
} from '@syncfusion/ej2-angular-lineargauge';
Some Linear Gauge features require module injection in TypeScript.
import {
Annotations,
GaugeTooltip,
Gradient,
ImageExport,
LinearGauge,
PdfExport,
Print
} from '@syncfusion/ej2-lineargauge';
LinearGauge.Inject(
Annotations,
GaugeTooltip,
Gradient,
ImageExport,
PdfExport,
Print
);
Inject only the modules required by the application.
Use the following module mapping:
Annotations -> Annotations
Tooltips -> GaugeTooltip
Gradients -> Gradient
Image export -> ImageExport
PDF export -> PdfExport
Printing -> Print
Global JavaScript bundles may already include these features, depending on how the scripts are packaged.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<title>Syncfusion EJ2 Linear Gauge</title>
<style>
* {
box-sizing: border-box;
}
body {
margin: 0;
padding: 24px;
background: #f8fafc;
color: #111827;
font-family: Arial, Helvetica, sans-serif;
}
main {
width: min(100%, 1000px);
margin: 0 auto;
}
h1 {
margin: 0 0 8px;
font-size: 26px;
}
.description {
margin: 0 0 16px;
line-height: 1.5;
}
.gauge-card {
padding: 16px;
border: 1px solid #cbd5e1;
border-radius: 12px;
background: #ffffff;
}
#gauge-container {
display: block;
width: 100%;
height: 340px;
}
</style>
</head>
<body>
<main>
<h1>System Utilization</h1>
<p class="description">
The Linear Gauge shows the current system
utilization on a scale from 0 to 100.
</p>
<section
class="gauge-card"
aria-label="System utilization gauge"
>
<div id="gauge-container"></div>
</section>
</main>
</body>
</html>
import {
LinearGauge
} from '@syncfusion/ej2-lineargauge';
const gauge: LinearGauge =
new LinearGauge({
width: '100%',
height: '100%',
orientation: 'Horizontal',
title: 'Current Utilization',
titleStyle: {
color: '#111827',
fontFamily: 'Arial',
size: '18px',
fontWeight: '700'
},
container: {
width: 28,
height: 0,
type: 'RoundedRectangle',
backgroundColor: '#e2e8f0',
roundedCornerRadius: 8,
border: {
color: '#94a3b8',
width: 1
}
},
axes: [
{
minimum: 0,
maximum: 100,
showLastLabel: true,
majorTicks: {
interval: 20,
position: 'Outside',
height: 10,
width: 2,
color: '#334155'
},
minorTicks: {
interval: 5,
position: 'Outside',
height: 5,
width: 1,
color: '#64748b'
},
labelStyle: {
format: '{value}%',
position: 'Outside',
offset: 8,
font: {
fontFamily: 'Arial',
size: '13px',
color: '#334155',
fontWeight: '600'
}
},
ranges: [
{
start: 0,
end: 30,
color: '#166534',
position: 'Inside',
startWidth: 15,
endWidth: 15
},
{
start: 30,
end: 70,
color: '#854d0e',
position: 'Inside',
startWidth: 15,
endWidth: 15
},
{
start: 70,
end: 100,
color: '#991b1b',
position: 'Inside',
startWidth: 15,
endWidth: 15
}
],
pointers: [
{
value: 45,
type: 'Bar',
color: '#1e293b',
width: 11,
position: 'Cross',
roundedCornerRadius: 4,
animationDuration: 700,
description:
'Current system utilization is 45 percent'
}
]
}
]
});
gauge.appendTo('#gauge-container');
var gauge =
new ej.lineargauge.LinearGauge({
width: '100%',
height: '100%',
orientation: 'Horizontal',
title: 'Current Utilization',
titleStyle: {
color: '#111827',
fontFamily: 'Arial',
size: '18px',
fontWeight: '700'
},
container: {
width: 28,
height: 0,
type: 'RoundedRectangle',
backgroundColor: '#e2e8f0',
roundedCornerRadius: 8,
border: {
color: '#94a3b8',
width: 1
}
},
axes: [
{
minimum: 0,
maximum: 100,
showLastLabel: true,
majorTicks: {
interval: 20,
position: 'Outside',
height: 10,
width: 2,
color: '#334155'
},
minorTicks: {
interval: 5,
position: 'Outside',
height: 5,
width: 1,
color: '#64748b'
},
labelStyle: {
format: '{value}%',
position: 'Outside',
offset: 8,
font: {
fontFamily: 'Arial',
size: '13px',
color: '#334155',
fontWeight: '600'
}
},
ranges: [
{
start: 0,
end: 30,
color: '#166534',
position: 'Inside',
startWidth: 15,
endWidth: 15
},
{
start: 30,
end: 70,
color: '#854d0e',
position: 'Inside',
startWidth: 15,
endWidth: 15
},
{
start: 70,
end: 100,
color: '#991b1b',
position: 'Inside',
startWidth: 15,
endWidth: 15
}
],
pointers: [
{
value: 45,
type: 'Bar',
color: '#1e293b',
width: 11,
position: 'Cross',
roundedCornerRadius: 4,
animationDuration: 700,
description:
'Current system utilization is 45 percent'
}
]
}
]
});
gauge.appendTo('#gauge-container');
Use a vertical gauge with a Thermometer container when the data represents temperature.
import {
LinearGauge
} from '@syncfusion/ej2-lineargauge';
const currentTemperature: number = 24;
const gauge: LinearGauge =
new LinearGauge({
width: '100%',
height: '500px',
orientation: 'Vertical',
container: {
type: 'Thermometer',
width: 30,
backgroundColor: '#e2e8f0',
border: {
color: '#64748b',
width: 1
}
},
axes: [
{
minimum: 0,
maximum: 50,
majorTicks: {
interval: 10,
position: 'Outside'
},
minorTicks: {
interval: 2,
position: 'Outside'
},
labelStyle: {
format: '{value}°C',
position: 'Outside'
},
ranges: [
{
start: 0,
end: 15,
color: '#2563eb',
startWidth: 12,
endWidth: 12
},
{
start: 15,
end: 30,
color: '#166534',
startWidth: 12,
endWidth: 12
},
{
start: 30,
end: 50,
color: '#991b1b',
startWidth: 12,
endWidth: 12
}
],
pointers: [
{
value: currentTemperature,
type: 'Bar',
width: 16,
color: '#b91c1c',
roundedCornerRadius: 4,
description:
'Current temperature is 24 degrees Celsius'
}
]
}
]
});
gauge.appendTo('#gauge-container');
Use a marker pointer with enableDrag: true.
Configure drag events on the LinearGauge object, not on the pointer.
import {
LinearGauge,
IPointerDragEventArgs
} from '@syncfusion/ej2-lineargauge';
let gaugeValue: number = 50;
const gauge: LinearGauge =
new LinearGauge({
axes: [
{
minimum: 0,
maximum: 100,
pointers: [
{
value: gaugeValue,
type: 'Marker',
markerType: 'Circle',
height: 28,
width: 28,
color: '#2563eb',
enableDrag: true,
description:
'Drag to change the gauge value'
}
]
}
],
dragMove: (
args: IPointerDragEventArgs
): void => {
gaugeValue =
Math.round(args.currentValue);
console.log(
'Current drag value:',
gaugeValue
);
},
dragEnd: (
args: IPointerDragEventArgs
): void => {
gaugeValue =
Math.round(args.currentValue);
gauge.setPointerValue(
0,
0,
gaugeValue
);
console.log(
'Gauge value changed to:',
gaugeValue
);
}
});
gauge.appendTo('#gauge-container');
Always use args.currentValue.
dragEnd: (
args: IPointerDragEventArgs
): void => {
const value: number =
args.currentValue;
}
Do not use an undeclared global event.
// Avoid.
const value = event.currentValue;
Use multiple pointer objects to compare current, target, and average values.
import {
LinearGauge
} from '@syncfusion/ej2-lineargauge';
const actualValue: number = 65;
const targetValue: number = 80;
const averageValue: number = 70;
const gauge: LinearGauge =
new LinearGauge({
axes: [
{
minimum: 0,
maximum: 100,
pointers: [
{
value: actualValue,
type: 'Bar',
color: '#2563eb',
width: 13,
description:
'Actual value is 65 percent'
},
{
value: targetValue,
type: 'Marker',
markerType: 'Circle',
color: '#c2410c',
height: 18,
width: 18,
position: 'Outside',
placement: 'Near',
offset: 8,
description:
'Target value is 80 percent'
},
{
value: averageValue,
type: 'Marker',
markerType: 'Triangle',
color: '#15803d',
height: 18,
width: 18,
position: 'Outside',
placement: 'Far',
offset: 8,
description:
'Average value is 70 percent'
}
]
}
]
});
gauge.appendTo('#gauge-container');
Use setPointerValue() when only a pointer value changes.
function updateGaugeValue(
requestedValue: number
): void {
const axisIndex: number = 0;
const pointerIndex: number = 0;
const axis = gauge.axes[axisIndex];
const safeValue: number =
Math.min(
axis.maximum,
Math.max(
axis.minimum,
requestedValue
)
);
gauge.setPointerValue(
axisIndex,
pointerIndex,
safeValue
);
}
Use refresh() when changing:
Inject the required modules.
import {
ImageExport,
LinearGauge,
PdfExport,
Print
} from '@syncfusion/ej2-lineargauge';
LinearGauge.Inject(
ImageExport,
PdfExport,
Print
);
Enable the matching features.
const gauge: LinearGauge =
new LinearGauge({
allowImageExport: true,
allowPdfExport: true,
allowPrint: true
});
Export image formats.
gauge.export(
'PNG',
'linear-gauge'
);
gauge.export(
'JPEG',
'linear-gauge'
);
gauge.export(
'SVG',
'linear-gauge'
);
Export PDF.
gauge.export(
'PDF',
'linear-gauge'
);
Print the gauge.
gauge.print();
The print() method does not export PNG or PDF. It opens the browser print flow.
width: Controls the complete gauge width using CSS-compatible dimensions.height: Controls the complete gauge height using CSS-compatible dimensions.orientation: Specifies Horizontal or Vertical.background: Specifies the gauge-area background.border: Customizes the gauge-area boundary.margin: Controls spacing around gauge content.container: Customizes the internal graphical container.axes: Configures one or more axes.annotations: Configures annotation content.title: Specifies the gauge title.titleStyle: Customizes title text.animationDuration: Configures complete-gauge animation.allowPrint: Enables printing.allowImageExport: Enables PNG, JPEG, and SVG export.allowPdfExport: Enables PDF export.description: Supplies information for assistive technology.locale: Sets the component locale.theme: Applies a supported built-in theme.container.width: Controls internal container thickness using a number.container.height: Controls internal container length using a number.container.type: Specifies Normal, RoundedRectangle, or Thermometer.container.offset: Moves the internal container relative to the axis.container.backgroundColor: Specifies the internal container background.container.border: Customizes the internal container border.container.roundedCornerRadius: Rounds a RoundedRectangle container.Do not use internal container dimensions to size the complete component.
const gauge: LinearGauge =
new LinearGauge({
width: '100%',
height: '350px',
container: {
width: 30,
height: 0
}
});
axes[].minimum: Specifies the minimum scale value.axes[].maximum: Specifies the maximum scale value.axes[].isInversed: Reverses scale direction.axes[].opposedPosition: Places the axis on the opposite side.axes[].showLastLabel: Shows or hides the final label.axes[].line: Customizes the axis line.axes[].majorTicks: Configures major ticks.axes[].minorTicks: Configures minor ticks.axes[].labelStyle: Configures axis labels.axes[].ranges: Configures value regions.axes[].pointers: Configures value indicators.ranges[].start: Specifies the range start.ranges[].end: Specifies the range end.ranges[].color: Specifies a solid range color.ranges[].startWidth: Specifies thickness at the range start.ranges[].endWidth: Specifies thickness at the range end.ranges[].offset: Moves the range relative to the axis.ranges[].position: Specifies Inside, Outside, Cross, or Auto.ranges[].border: Customizes the range border.ranges[].linearGradient: Applies a linear gradient.ranges[].radialGradient: Applies a radial gradient.pointers[].value: Specifies the pointer value.pointers[].type: Specifies Bar or Marker.pointers[].color: Specifies the pointer color.pointers[].width: Specifies pointer width.pointers[].height: Specifies marker height.pointers[].markerType: Specifies the marker shape.pointers[].position: Positions the pointer relative to the axis.pointers[].placement: Positions a marker within its selected side.pointers[].offset: Moves the pointer relative to the axis.pointers[].border: Customizes the pointer border.pointers[].opacity: Specifies pointer opacity.pointers[].animationDuration: Configures pointer animation.pointers[].enableDrag: Enables pointer dragging.pointers[].description: Provides an accessible pointer description.pointers[].roundedCornerRadius: Rounds a bar pointer.pointers[].imageUrl: Specifies an image marker.pointers[].text: Specifies text-marker content.pointers[].textStyle: Customizes a text pointer.Update a pointer:
gauge.setPointerValue(
axisIndex,
pointerIndex,
value
);
Re-render after model or layout changes:
gauge.refresh();
Export the gauge:
gauge.export(
type,
fileName,
orientation,
allowDownload
);
Print the gauge:
gauge.print();
Destroy the gauge:
gauge.destroy();
const gauge: LinearGauge =
new LinearGauge({
axes: []
});
gauge.appendTo('#gauge-container');
Do not use Angular decorators, Angular bindings, or Angular wrapper components in TypeScript and JavaScript references.
Use gauge-level dimensions for the complete component.
width: '100%',
height: '350px'
Use numeric internal container dimensions.
container: {
width: 30,
height: 0
}
const gauge: LinearGauge =
new LinearGauge({
dragEnd: (
args: IPointerDragEventArgs
): void => {
console.log(args.currentValue);
}
});
Do not configure dragEnd inside a pointer object.
markerType: 'InvertedTriangle'
Do not use:
markerType: 'Inverted Triangle'
For gradients:
LinearGauge.Inject(Gradient);
For annotations:
LinearGauge.Inject(Annotations);
For tooltips:
LinearGauge.Inject(GaugeTooltip);
For printing and export:
LinearGauge.Inject(
Print,
ImageExport,
PdfExport
);
Do not use CSS gradient strings for range or pointer colors.
// Avoid.
color:
'linear-gradient(to right, #2563eb, #16a34a)'
Use linearGradient or radialGradient and inject Gradient.
A gauge is a visualization. Use a native form control when users must edit its value by keyboard.
<label for="gauge-value">
Utilization
</label>
<input
id="gauge-value"
type="range"
min="0"
max="100"
step="5"
value="50"
/>
Update the pointer using:
gauge.setPointerValue(
0,
0,
Number(input.value)
);
Remove application listeners, clear timers, and destroy the gauge.
window.clearInterval(timer);
input.removeEventListener(
'input',
handleInput
);
gauge.destroy();
Before returning or publishing a Linear Gauge example, verify the following:
@syncfusion/ej2-lineargauge.appendTo() is called.width and height use CSS-compatible strings.container.width and container.height use numbers.height and width.InvertedTriangle.args.currentValue.setPointerValue().refresh().allowImageExport.allowPdfExport.allowPrint.print() is not described as an export method.Gradient module and gradient models.// Incorrect for pure TypeScript.
import {
LinearGaugeAllModule
} from '@syncfusion/ej2-angular-gauges';
Use:
import {
LinearGauge
} from '@syncfusion/ej2-lineargauge';
// Incorrect use of the internal container.
container: {
width: '100%',
height: '350px'
}
Use:
width: '100%',
height: '350px',
container: {
width: 30,
height: 0
}
// Incorrect.
dragEnd: (
args: IPointerDragEventArgs
): void => {
console.log(event.currentValue);
}
Use:
dragEnd: (
args: IPointerDragEventArgs
): void => {
console.log(args.currentValue);
}
// Incorrect.
markerType: 'Inverted Triangle'
Use:
markerType: 'InvertedTriangle'
// Incorrect.
color:
'linear-gradient(to right, red, green)'
Use the Gradient module and linearGradient.
// Prints the gauge.
gauge.print();
Use export() for files:
gauge.export(
'PNG',
'linear-gauge'
);
Avoid refreshing the complete gauge for pointer-only updates.
gauge.axes[0].pointers[0].value =
newValue;
gauge.refresh();
Prefer:
gauge.setPointerValue(
0,
0,
newValue
);
When responding to Linear Gauge implementation requests:
@syncfusion/ej2-lineargauge for pure TypeScript.setPointerValue() for pointer-only updates.refresh() for broader configuration changes.references/API-Refernce_JavaScript.md (opens in a new tab)references/API-Refernce_TypeScript.md (opens in a new tab)references/advanced-features.md (opens in a new tab)references/axis-and-scales.md (opens in a new tab)references/customization-and-appearance.md (opens in a new tab)references/dimensions-and-responsive.md (opens in a new tab)references/getting-started.md (opens in a new tab)references/interaction-and-events.md (opens in a new tab)references/ranges-and-pointers.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub syncfusion/boldcreate-plugins --plugin syncfusion-javascriptOther plugins' skills for the same job
67 skills in this plugin
/syncfusion-javascript-3d-chartCreate interactive 3D charts in Syncfusion TypeScript and JavaScript. Immediately use this skill when user needs to build 3D visualizations, render 3D column/bar charts, configure 3D rotation and depth, visualize data in three dimensions, customize 3D chart appearance, handle 3D interactions, or implement advanced 3D features. Works with TypeScript (webpack/module-based) and JavaScript (CDN/ES5)./syncfusion-javascript-accordionBuild collapsible navigation panels with the Syncfusion TypeScript Accordion component. Use this skill when implementing vertical accordion menus, expanding/collapsing content panels, multi-step wizards, data-driven panels with dynamic content, tabbed navigation alternatives, or nested hierarchical content structures. Covers initialization, expand modes, animations, icons, templates, styling, data binding, and advanced use cases like form wizards./syncfusion-javascript-accumulation-chartImplements Syncfusion JavaScript accumulation charts (Pie, Doughnut, Funnel, Pyramid) for proportional and percentage-based visualizations. Use when displaying categorical or proportional data. Covers legend and label configuration, interactivity, accessibility, and customization. Works with TypeScript (modules) and JavaScript (CDN/ES5).