
Syncfusion React Range Navigator
- 384 installs
- 3 repo stars
- Updated July 28, 2026
- syncfusion/react-ui-components-skills
Use syncfusion-react-range-navigator for development tasks
About
syncfusion-react-range-navigator: A skill for development. This provides functionality for development workflows.
- syncfusion-react-range-navigator
Syncfusion React Range Navigator by the numbers
- 384 all-time installs (skills.sh)
- +52 installs in the week ending Aug 5, 2026 (Skillselion tracking)
- Ranked #1,130 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/syncfusion/react-ui-components-skills --skill syncfusion-react-range-navigatorAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 384 |
|---|---|
| repo stars | ★ 3 |
| Last updated | July 28, 2026 |
| Repository | syncfusion/react-ui-components-skills ↗ |
What it does
Use syncfusion-react-range-navigator for development tasks
Files
Syncfusion React Range Navigator
A comprehensive skill for implementing the Syncfusion React Range Navigator component - a powerful data visualization control that allows users to scroll and navigate through data with range selection capabilities. This component easily combines with other controls like Charts and Data Grids to create rich dashboards.
When to Use This Skill
Use this skill when you need to:
- Install and set up the Range Navigator component in a React application
- Implement range selection and navigation for time-series or numeric data
- Display financial data, stock charts, or large datasets requiring navigation
- Configure data binding with numeric, logarithmic, or DateTime value types
- Customize series types (Line, Area, StepLine)
- Add period selectors for predefined time intervals
- Enable lightweight mode without chart data
- Customize navigator appearance (thumbs, borders, regions)
- Configure tooltips for range selection
- Customize labels, grid lines, and tick lines
- Enable accessibility features or RTL support
- Export or print Range Navigator charts
- Integrate Range Navigator with other chart components
Component Overview
Range Navigator is a data visualization control that provides intuitive range selection and navigation capabilities for large datasets. It displays a condensed view of data with interactive sliders that allow users to select specific ranges. The component is particularly useful for:
- Financial Data Visualization: Stock price analysis, trading data, market trends
- Time-Series Navigation: Historical data exploration, date range selection
- Large Dataset Filtering: Scroll through extensive data collections efficiently
- Dashboard Integration: Combine with Charts, Grids, and other components
Key Features:
- Multiple data source support (local and remote)
- Interactive tooltip and animation
- Lightweight mode for mobile devices
- Period selector for custom time intervals
- Multiple axis and series types
- Export to image formats (PNG, JPEG, SVG, PDF)
Documentation and Navigation Guide
API Reference
📄 Read: references/api.md
- Comprehensive API summary: props, methods, events, styling classes, and a short usage example. Links to official docs.
Getting Started
📄 Read: references/getting-started.md
- Installation and dependencies (@syncfusion/ej2-react-charts package)
- Setting up development environment (Vite/Create React App)
- Adding CSS stylesheets and themes
- Basic Range Navigator implementation
- Module injection (AreaSeries, DateTime, RangeTooltip)
- Populating with data (dataSource, xName, yName)
- Enabling tooltip
- Running your first application
Data Binding and Value Types
📄 Read: references/data-binding.md
- Numeric value type (default Double type)
- Range configuration (minimum, maximum, interval)
- Numeric label formatting (n1, n2, p1, c1, custom formats)
- Logarithmic axis for magnitude data
- Logarithmic range and base customization
- DateTime value type for time-series data
- DateTime interval types (Auto, Years, Quarter, Months, Weeks, Days, Hours, Minutes, Seconds)
- DateTime label formatting
- Complete format reference tables
Series Types
📄 Read: references/series-types.md
- Line series (default, LineSeries module)
- Area series (AreaSeries module)
- StepLine series (StepLineSeries module)
- Module injection for each series type
- Configuration and implementation examples
Customization
📄 Read: references/customization.md
- Navigator appearance (navigatorStyleSettings)
- Selected and unselected region colors
- Thumb customization (Circle/Rectangle shapes, size, border, fill)
- Border customization (width, color)
- Deferred update for performance optimization
- Allow snapping for precise selection
- Animation duration control
Period Selector
📄 Read: references/period-selector.md
- Configuring predefined time periods
- Period array (interval, text, intervalType)
- Module injection (PeriodSelector)
- Positioning (Top or Bottom)
- Height customization
- Disabling range selector (period selector only mode)
- Interval types (Auto, Years, Quarter, Months, Weeks, Days, Hours, Minutes, Seconds)
Lightweight Mode
📄 Read: references/lightweight.md
- Lightweight Range Navigator without chart data
- When to use lightweight mode
- Mobile-friendly implementation
- Basic configuration
Tooltip
📄 Read: references/tooltip.md
- Enabling and disabling tooltip
- Tooltip customization (fill, opacity, textStyle)
- Label format for tooltips
- Date and time format options
- Complete format reference table
Labels
📄 Read: references/labels.md
- Multilevel labels (enableGrouping for DateTime)
- Grouping by intervals (Auto, Years, Quarter, Months, Weeks, Days, Hours, Minutes, Seconds)
- Smart labels to avoid overlapping (labelIntersectAction)
- Label positioning (inside or outside)
- Label style customization (font, color, family, weight, size)
Grid Lines and Tick Lines
📄 Read: references/grid-and-tick.md
- Grid line customization (majorGridLines)
- Grid line width, color, and dashArray
- Tick line customization (majorTickLines)
- Tick line width, color, and dashArray
- Configuration examples
Accessibility
📄 Read: references/accessibility.md
- Keyboard navigation support
- Screen reader compatibility
- WCAG 2.0 compliance
- Accessibility features and best practices
Right-to-Left (RTL) Support
📄 Read: references/rtl.md
- Enabling RTL mode (enableRtl property)
- RTL layout behavior
- Implementation examples
Export and Print
📄 Read: references/export-print.md
- Export to image formats (PNG, JPEG, SVG, PDF)
- Print functionality
- Export/print method usage
- Configuration options
Quick Start Example
import * as React from 'react';
import { RangeNavigatorComponent, AreaSeries, DateTime, RangeTooltip, Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective } from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
// Register your Syncfusion license key
import { registerLicense } from '@syncfusion/ej2-base';
registerLicense('YOUR_LICENSE_KEY');
function App() {
const data = [
{ x: new Date(2018, 0, 1), y: 35 },
{ x: new Date(2018, 1, 1), y: 28 },
{ x: new Date(2018, 2, 1), y: 34 },
{ x: new Date(2018, 3, 1), y: 32 },
{ x: new Date(2018, 4, 1), y: 40 },
{ x: new Date(2018, 5, 1), y: 42 },
{ x: new Date(2018, 6, 1), y: 38 }
];
return (
<RangeNavigatorComponent
id="rangeNavigator"
valueType="DateTime"
value={[new Date(2018, 1, 1), new Date(2018, 4, 1)]}
tooltip={{ enable: true }}
>
<Inject services={[AreaSeries, DateTime, RangeTooltip]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="x"
yName="y"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Common Patterns
Pattern 1: Time-Series Data Navigation
When user needs: Navigate through time-series data with date range selection
Implementation:
import * as React from 'react';
import { RangeNavigatorComponent, AreaSeries, DateTime, RangeTooltip, Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective } from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
function App() {
const data = [
{ x: new Date(2018, 0, 1), y: 35 },
{ x: new Date(2018, 1, 1), y: 28 },
{ x: new Date(2018, 2, 1), y: 34 },
{ x: new Date(2018, 3, 1), y: 32 },
{ x: new Date(2018, 4, 1), y: 40 },
{ x: new Date(2018, 5, 1), y: 42 },
{ x: new Date(2018, 6, 1), y: 38 }
];
return (
<RangeNavigatorComponent
valueType="DateTime"
intervalType="Months"
labelFormat="MMM"
value={[new Date(2018, 0, 1), new Date(2018, 6, 1)]}
tooltip={{ enable: true, displayMode: 'Always' }}>
<Inject services={[AreaSeries, DateTime, RangeTooltip]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="x"
yName="y"
type="Area"/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
)
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Pattern 2: Financial Data with Period Selector
When user needs: Stock chart navigation with predefined time periods (1M, 3M, 6M, YTD, 1Y)
Implementation:
import * as React from 'react';
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
RangeTooltip,
PeriodSelector,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective,
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from 'react-dom';
function App() {
const data = [
{ x: new Date(2018, 0, 1), y: 35 },
{ x: new Date(2018, 1, 1), y: 28 },
{ x: new Date(2018, 2, 1), y: 34 },
{ x: new Date(2018, 3, 1), y: 32 },
{ x: new Date(2018, 4, 1), y: 40 },
{ x: new Date(2018, 5, 1), y: 42 },
{ x: new Date(2018, 6, 1), y: 38 }
];
return (
<RangeNavigatorComponent
valueType="DateTime"
value={[new Date(2023, 0, 1), new Date(2023, 11, 31)]}
periodSelectorSettings={{
periods: [
{ intervalType: 'Months', interval: 1, text: '1M' },
{ intervalType: 'Months', interval: 3, text: '3M' },
{ intervalType: 'Months', interval: 6, text: '6M' },
{ intervalType: 'Years', interval: 1, text: '1Y' },
{ text: 'YTD' },
],
position: 'Top',
}}
>
<Inject
services={[
AreaSeries,
DateTime,
RangeTooltip,
PeriodSelector,
]}
/>
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="x"
yName="y"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById('charts'));Pattern 3: Custom Styling and Appearance
When user needs: Customize navigator colors, thumbs, and borders
Implementation:
<RangeNavigatorComponent
navigatorStyleSettings={{
selectedRegionColor: 'rgba(33, 150, 243, 0.3)',
unselectedRegionColor: 'transparent',
thumb: {
type: 'Circle',
fill: '#2196F3',
border: { width: 2, color: '#ffffff' },
height: 20,
width: 20
}
}}
navigatorBorder={{ width: 2, color: '#2196F3' }}
>
{/* Series configuration */}
</RangeNavigatorComponent>Pattern 4: Lightweight Mode for Mobile
When user needs: Simple range selector without chart data for mobile devices
Implementation:
<RangeNavigatorComponent
valueType="DateTime"
value={[new Date(2018, 0, 1), new Date(2018, 6, 1)]}
intervalType="Months"
>
<Inject services={[DateTime]} />
{/* No series - lightweight mode */}
</RangeNavigatorComponent>Pattern 5: Logarithmic Scale for Large Ranges
When user needs: Handle data with values spanning multiple orders of magnitude
Implementation:
import { RangeNavigatorComponent, LineSeries, Logarithmic, Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective } from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
<RangeNavigatorComponent
valueType="Logarithmic"
logBase={10}
minimum={100}
maximum={100000}
interval={1}
>
<Inject services={[LineSeries, Logarithmic]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={logData}
xName="x"
yName="y"
type="Line"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>Key Props
Core Configuration
- valueType:
'Double' | 'DateTime' | 'Logarithmic'- Axis value type (default: 'Double') - value:
number[] | Date[]- Initial selected range [start, end] - minimum:
number | Date- Minimum value of the axis - maximum:
number | Date- Maximum value of the axis - interval:
number- Axis interval - intervalType: Interval type for DateTime ('Auto' | 'Years' | 'Quarter' | 'Months' | 'Weeks' | 'Days' | 'Hours' | 'Minutes' | 'Seconds')
Series Configuration
- series: Array of series objects with dataSource, xName, yName, type
- dataSource: Data array for the series
- xName: Field name for x-axis values
- yName: Field name for y-axis values
- type:
'Line' | 'Area' | 'StepLine'- Series rendering type
Appearance
- navigatorStyleSettings: Customize selected/unselected regions and thumbs
- navigatorBorder: Border width and color
- theme:
'Material' | 'Bootstrap' | 'Fabric' | 'Fluent' | 'Tailwind'
Features
- tooltip: Tooltip configuration (enable, fill, opacity, textStyle, labelFormat)
- periodSelectorSettings: Period selector configuration (periods, position, height)
- enableDeferredUpdate: Trigger change event after drag completion (default: false)
- allowSnapping: Snap slider to nearest interval (default: false)
- enableGrouping: Enable multilevel labels for DateTime (default: false)
- groupBy: Grouping interval type for multilevel labels
- labelPosition:
'Outside' | 'Inside'- Label position - enableRtl: Enable right-to-left rendering
Events
- changed: Fired when range selection changes
- load: Fired before rendering
- loaded: Fired after rendering
- tooltipRender: Fired before tooltip renders
Common Use Cases
Use Case 1: Stock Chart with Range Navigation
Implement a financial stock chart with range selection for analyzing price trends over time. Use DateTime axis, Area series, and period selector for quick time range selection.
Use Case 2: Dashboard Data Filtering
Integrate Range Navigator with Data Grid to filter large datasets based on date or numeric ranges. Use the changed event to update the grid data source.
Use Case 3: Historical Data Analysis
Analyze historical sales, weather, or analytics data by providing intuitive range selection with tooltips showing exact values.
Use Case 4: Mobile-Friendly Navigation
Use lightweight mode for mobile applications where chart rendering is not needed, providing simple range selection UI.
Use Case 5: Multi-Magnitude Data Visualization
Display scientific or financial data spanning multiple orders of magnitude (10^-6 to 10^6) using logarithmic scale.
Module Injection Requirements
The Range Navigator requires module injection for specific features:
import { Inject } from '@syncfusion/ej2-react-charts';
// For Area series
import { AreaSeries } from '@syncfusion/ej2-react-charts';
<Inject services={[AreaSeries]} />
// For DateTime axis
import { DateTime } from '@syncfusion/ej2-react-charts';
<Inject services={[DateTime]} />
// For tooltips
import { RangeTooltip } from '@syncfusion/ej2-react-charts';
<Inject services={[RangeTooltip]} />
// For period selector
import { PeriodSelector } from '@syncfusion/ej2-react-charts';
<Inject services={[PeriodSelector]} />
// For logarithmic scale
import { Logarithmic } from '@syncfusion/ej2-react-charts';
<Inject services={[Logarithmic]} />
// For line series
import { LineSeries } from '@syncfusion/ej2-react-charts';
<Inject services={[LineSeries]} />
// For step line series
import { StepLineSeries } from '@syncfusion/ej2-react-charts';
<Inject services={[StepLineSeries]} />Always inject all required modules in a single Inject component based on the features you're using.
Accessibility
The Range Navigator component follows accessibility guidelines and standards, including ADA, Section 508, WCAG 2.2, and WAI-ARIA roles, ensuring it's usable by people with disabilities and assistive technologies.
Table of contents
- Accessibility Compliance
- WAI-ARIA Attributes
- ARIA Roles Used
- Basic Implementation with ARIA
- Keyboard Navigation
- Supported Keyboard Shortcuts
- Enabling Keyboard Navigation
- Screen Reader Support
- Screen Reader Compatibility
- Implementing for Screen Readers
- Color Contrast
- Contrast Requirements
- High Contrast Theme
- Right-to-Left (RTL) Support
- Mobile Device Support
- Accessibility Testing
- Automated Testing Tools
- Running Accessibility Tests
- Best Practices for Accessibility
- Complete Accessible Example
- Accessibility Compliance Summary
- Resources
- Testing Resources
- Key Points
Accessibility Compliance
The Range Navigator component meets the following accessibility standards:
| Accessibility Criteria | Support Level |
|---|---|
| WCAG 2.2 Support | ✅ Full Support |
| Section 508 Support | ✅ Full Support |
| Screen Reader Support | ✅ Full Support |
| Right-to-Left Support | ✅ Full Support |
| Color Contrast | ✅ Full Support |
| Mobile Device Support | ✅ Full Support |
| Keyboard Navigation | ✅ Full Support |
| Accessibility Checker Validation | ✅ Full Support |
| Axe-core Validation | ✅ Full Support |
Legend:
- ✅ Full Support - All features meet the requirement
- ⚠️ Partial Support - Some features meet the requirement
- ❌ Not Supported - Component does not meet the requirement
WAI-ARIA Attributes
The Range Navigator component implements WAI-ARIA patterns to ensure proper accessibility for screen readers and assistive technologies.
ARIA Roles Used
- region: Identifies the Range Navigator as a distinct region
- aria-label: Provides accessible names for interactive elements
Basic Implementation with ARIA
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective,
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from 'react-dom';
import * as React from 'react';
function App() {
const data = [
{ date: new Date(2023, 0, 1), value: 100 },
{ date: new Date(2023, 1, 1), value: 110 },
{ date: new Date(2023, 2, 1), value: 105 },
{ date: new Date(2023, 3, 1), value: 115 },
];
return (
<RangeNavigatorComponent
id="rangeNavigator"
valueType="DateTime"
labelFormat="MMM"
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="date"
yName="value"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById('charts'));The Range Navigator automatically includes appropriate ARIA attributes for accessibility.
Keyboard Navigation
The Range Navigator supports comprehensive keyboard navigation, following keyboard interaction guidelines for assistive technologies.
Supported Keyboard Shortcuts
| Key | Action |
|---|---|
| <kbd>Tab</kbd> | Moves focus to the Range Navigator element |
| <kbd>Ctrl</kbd> + <kbd>P</kbd> | Prints the Range Navigator |
Enabling Keyboard Navigation
Keyboard navigation is enabled by default. Users can: 1. Tab to focus the Range Navigator 2. Use additional keyboard shortcuts for interaction
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const data = [
{ date: new Date(2023, 0, 1), value: 100 },
{ date: new Date(2023, 1, 1), value: 110 },
{ date: new Date(2023, 2, 1), value: 105 },
{ date: new Date(2023, 3, 1), value: 115 }
];
return (
<div>
<h2>Accessible Range Navigator</h2>
<p>Press Tab to focus the Range Navigator, Ctrl+P to print</p>
<RangeNavigatorComponent
id="rangeNavigator"
valueType="DateTime"
labelFormat="MMM"
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="date"
yName="value"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
</div>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Screen Reader Support
The Range Navigator provides full screen reader support, ensuring users with visual impairments can navigate and interact with the component.
Screen Reader Compatibility
- JAWS: Full support
- NVDA: Full support
- VoiceOver: Full support (macOS, iOS)
- TalkBack: Full support (Android)
- Narrator: Full support (Windows)
Implementing for Screen Readers
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
RangeTooltip,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const data = [
{ date: new Date(2023, 0, 1), value: 100 },
{ date: new Date(2023, 1, 1), value: 110 },
{ date: new Date(2023, 2, 1), value: 105 },
{ date: new Date(2023, 3, 1), value: 115 }
];
return (
<div role="main" aria-label="Data Visualization">
<h2 id="chart-title">Sales Range Navigator</h2>
<p id="chart-description">
Select a date range to filter sales data from January to April 2023
</p>
<RangeNavigatorComponent
id="rangeNavigator"
valueType="DateTime"
labelFormat="MMM"
tooltip={{ enable: true }}
>
<Inject services={[AreaSeries, DateTime, RangeTooltip ]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="date"
yName="value"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
</div>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Color Contrast
The Range Navigator ensures WCAG 2.2 AAA color contrast requirements are met.
Contrast Requirements
- Normal Text: Minimum 4.5:1 contrast ratio
- Large Text: Minimum 3:1 contrast ratio
- UI Components: Minimum 3:1 contrast ratio
High Contrast Theme
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const data = [
{ date: new Date(2023, 0, 1), value: 100 },
{ date: new Date(2023, 1, 1), value: 110 },
{ date: new Date(2023, 2, 1), value: 105 },
{ date: new Date(2023, 3, 1), value: 115 }
];
return (
<RangeNavigatorComponent
id="rangeNavigator"
valueType="DateTime"
labelFormat="MMM"
theme="HighContrast"
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="date"
yName="value"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Right-to-Left (RTL) Support
The Range Navigator fully supports RTL languages. For detailed RTL implementation, see the RTL reference documentation.
<RangeNavigatorComponent
id="rangeNavigator"
enableRtl={true}
valueType="DateTime"
>
{/* RTL layout enabled */}
</RangeNavigatorComponent>Mobile Device Support
The Range Navigator is fully responsive and accessible on mobile devices with:
- Touch gesture support
- Mobile-friendly sizing
- Responsive layout
- Optimized performance
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const data = [
{ date: new Date(2023, 0, 1), value: 100 },
{ date: new Date(2023, 1, 1), value: 110 },
{ date: new Date(2023, 2, 1), value: 105 },
{ date: new Date(2023, 3, 1), value: 115 }
];
return (
<div style={{ maxWidth: '100%', padding: '10px' }}>
<RangeNavigatorComponent
id="rangeNavigator"
valueType="DateTime"
labelFormat="MMM"
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="date"
yName="value"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
</div>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Accessibility Testing
The Range Navigator has been validated using:
Automated Testing Tools
1. Accessibility Checker
- NPM package:
accessibility-checker - Validates against WCAG 2.2 standards
2. Axe-core
- NPM package:
axe-core - Comprehensive accessibility testing
Running Accessibility Tests
# Install testing tools
npm install --save-dev accessibility-checker axe-core
# Run accessibility tests
npm run accessibility-testBest Practices for Accessibility
1. Provide Context
Always provide descriptive labels and context for the Range Navigator:
<div>
<h2 id="navigator-title">Sales Data Navigator</h2>
<p id="navigator-description">
Use the sliders to select a date range for viewing sales data
</p>
<RangeNavigatorComponent
id="rangeNavigator"
// Component configuration
/>
</div>2. Enable Tooltips
Tooltips provide additional context for screen reader users:
<RangeNavigatorComponent
tooltip={{
enable: true,
displayMode: 'Always'
}}
>
</RangeNavigatorComponent>3. Sufficient Color Contrast
Ensure custom colors meet WCAG contrast requirements:
<RangeNavigatorComponent
navigatorStyleSettings={{
selectedRegionColor: 'rgba(33, 150, 243, 0.3)',
thumb: {
fill: '#1976D2', // High contrast color
border: { width: 2, color: '#ffffff' }
}
}}
>
</RangeNavigatorComponent>4. Keyboard Accessibility
Ensure all functionality is accessible via keyboard:
// Default keyboard navigation is enabled
// No additional configuration needed5. Alternative Text
Provide meaningful descriptions for data:
<div>
<h2>Stock Price Range</h2>
<p>
Interactive range selector showing stock prices from January to December 2023.
Current selected range: March to October 2023.
</p>
<RangeNavigatorComponent
id="rangeNavigator"
// Configuration
/>
</div>Complete Accessible Example
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
RangeTooltip,
PeriodSelector,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const stockData = [
{ date: new Date(2023, 0, 1), price: 100 },
{ date: new Date(2023, 1, 1), price: 110 },
{ date: new Date(2023, 2, 1), price: 105 },
{ date: new Date(2023, 3, 1), price: 115 },
{ date: new Date(2023, 4, 1), price: 120 },
{ date: new Date(2023, 5, 1), price: 125 }
];
return (
<div role="main" aria-labelledby="chart-title">
<h1 id="chart-title">Stock Price Range Navigator</h1>
<p id="chart-description">
This interactive chart allows you to select a date range to analyze stock prices.
Use Tab to focus the navigator, and Ctrl+P to print.
</p>
<RangeNavigatorComponent
id="rangeNavigator"
valueType="DateTime"
labelFormat="MMM yyyy"
// Accessibility features
tooltip={{
enable: true,
displayMode: 'Always'
}}
// High contrast colors
navigatorStyleSettings={{
selectedRegionColor: 'rgba(33, 150, 243, 0.4)',
thumb: {
fill: '#1976D2',
border: { width: 3, color: '#ffffff' }
}
}}
// Period selector for keyboard users
periodSelectorSettings={{
periods: [
{ intervalType: 'Months', interval: 1, text: '1M' },
{ intervalType: 'Months', interval: 3, text: '3M' },
{ intervalType: 'Months', interval: 6, text: '6M' }
]
}}
>
<Inject services={[AreaSeries, DateTime, RangeTooltip, PeriodSelector]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={stockData}
xName="date"
yName="price"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
<div aria-live="polite" aria-atomic="true">
<p>Use the range navigator above to select a date range for detailed analysis.</p>
</div>
</div>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Accessibility Compliance Summary
| Standard | Compliance | Notes |
|---|---|---|
| WCAG 2.2 Level A | ✅ Fully Compliant | All criteria met |
| WCAG 2.2 Level AA | ✅ Fully Compliant | All criteria met |
| WCAG 2.2 Level AAA | ✅ Fully Compliant | All criteria met |
| Section 508 | ✅ Fully Compliant | All requirements met |
| ADA | ✅ Fully Compliant | Meets ADA standards |
Resources
Testing Resources
Key Points
1. Full Compliance: Range Navigator meets WCAG 2.2, Section 508, and ADA standards 2. Keyboard Navigation: Complete keyboard support with Tab and Ctrl+P shortcuts 3. Screen Readers: Compatible with all major screen readers 4. Color Contrast: Meets AAA contrast requirements 5. Mobile: Fully accessible on mobile devices 6. RTL Support: Complete right-to-left language support 7. Testing: Validated with automated accessibility tools 8. Best Practices: Follow accessibility guidelines for custom implementations
API Links
Full Range Navigator API: https://ej2.syncfusion.com/react/documentation/api/range-navigator/index-default
Accessibility-related complex API references and behaviors:
- `enableRtl` (RTL behavior), `enablePersistence` (persistence across sessions)
- Tooltip accessibility props: `tooltip` settings and
displayMode - Events and lifecycle: `load`, `loaded`, `changed`, `resized` (useful for accessibility announcements)
Range Navigator — API Reference
Official docs: https://ej2.syncfusion.com/react/documentation/api/range-navigator/index-default
Overview
This file summarizes the key public API surface for the Syncfusion React RangeNavigatorComponent used by the skill content: main props, methods, events, styling classes and a short usage example.
Key Props (selected)
valueType—'Double' | 'DateTime' | 'Logarithmic'(default:Double)value—number[] | Date[]— initial selected range[start, end]minimum/maximum—number | Dateinterval—number— axis intervalintervalType— DateTime interval types (Auto,Years,Months, ...)series—RangeNavigatorSeriesModel[]— array of series definitionsdataSource—Object[] | DataManager— series data sourcexName/yName— field names for seriesnavigatorStyleSettings— customize selected/unselected regions and thumbsnavigatorBorder— border config for navigatortooltip—RangeTooltip— tooltip configurationperiodSelectorSettings—PeriodSelectorSettingsModelenableDeferredUpdate,allowSnapping,enableGrouping,enablePersistence,enableRtl— boolean feature flags
Methods (selected)
destroy()— cleanup component instanceexport(type, fileName, orientation, controls, width, height, isVertical)— export to image/PDFprint(id)— print the componentrenderChart(resize)— re-render chart
Events
changed— fired when the selected range changes (use to filter other components)load/loaded— lifecycle eventsbeforeResize/resized— resize lifecyclelabelRender— customize label texttooltipRender— intercept tooltip content
Styling classes
.e-rangeselector.e-rangeselector-content.e-rangeselector-label.e-rangeselector-thumb.e-rangeselector-tooltip
Short Usage (React)
import React, { useRef } from 'react';
import {
RangeNavigatorComponent,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective,
Inject,
AreaSeries,
DateTime
} from '@syncfusion/ej2-react-charts';
const MyRange = ({ data }) => {
const ref = useRef(null);
return (
<RangeNavigatorComponent
id="rangeNavigator"
ref={ref}
valueType="DateTime"
value={[new Date(2020,0,1), new Date(2020,5,1)]}
tooltip={{ enable: true }}
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective dataSource={data} xName="x" yName="y" type="Area" />
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
};
export default MyRange;Notes and links
- For full, authoritative API details see the official documentation: https://ej2.syncfusion.com/react/documentation/api/range-navigator/index-default
Customization
The Range Navigator provides extensive customization options for its appearance and behavior, including navigator regions, thumbs, borders, update modes, snapping, and animation.
Table of Contents
- Navigator Appearance
- Thumb Customization
- Border Customization
- Deferred Update
- Allow Snapping
- Animation Duration
Navigator Appearance
Customize the Range Selector appearance using the navigatorStyleSettings property. You can configure colors for selected and unselected regions.
Selected and Unselected Regions
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const data = [
{ x: new Date(2023, 0, 1), y: 100 },
{ x: new Date(2023, 1, 1), y: 110 },
{ x: new Date(2023, 2, 1), y: 105 },
{ x: new Date(2023, 3, 1), y: 115 },
{ x: new Date(2023, 4, 1), y: 120 },
{ x: new Date(2023, 5, 1), y: 125 }
];
return (
<RangeNavigatorComponent
id="rangeNavigator"
valueType="DateTime"
navigatorStyleSettings={{
selectedRegionColor: 'rgba(33, 150, 243, 0.3)',
unselectedRegionColor: 'rgba(128, 128, 128, 0.1)'
}}
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="x"
yName="y"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Navigator Style Settings Properties
- selectedRegionColor: Color for the selected range (default: varies by theme)
- unselectedRegionColor: Color for the unselected regions (default: transparent)
Common Color Patterns
// Transparent unselected region (default)
navigatorStyleSettings={{
selectedRegionColor: 'rgba(33, 150, 243, 0.3)',
unselectedRegionColor: 'transparent'
}}
// Subtle gray for unselected
navigatorStyleSettings={{
selectedRegionColor: 'rgba(0, 123, 255, 0.4)',
unselectedRegionColor: 'rgba(200, 200, 200, 0.1)'
}}
// High contrast
navigatorStyleSettings={{
selectedRegionColor: 'rgba(76, 175, 80, 0.5)',
unselectedRegionColor: 'rgba(0, 0, 0, 0.05)'
}}Thumb Customization
Thumbs are the draggable handles on the Range Selector. Customize their appearance including shape, size, color, and border.
Thumb Properties
- type: Shape of the thumb ('Circle' | 'Rectangle')
- width: Width of the thumb in pixels
- height: Height of the thumb in pixels
- fill: Fill color of the thumb
- border: Border configuration (width, color)
Circle Thumb
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const data = [
{ x: new Date(2023, 0, 1), y: 100 },
{ x: new Date(2023, 1, 1), y: 110 },
{ x: new Date(2023, 2, 1), y: 105 },
{ x: new Date(2023, 3, 1), y: 115 }
];
return (
<RangeNavigatorComponent
id="rangeNavigator"
valueType="DateTime"
navigatorStyleSettings={{
thumb: {
type: 'Circle',
width: 20,
height: 20,
fill: '#2196F3',
border: { width: 2, color: '#ffffff' }
}
}}
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="x"
yName="y"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Rectangle Thumb
<RangeNavigatorComponent
id="rangeNavigator"
valueType="DateTime"
navigatorStyleSettings={{
thumb: {
type: 'Rectangle',
width: 15,
height: 40,
fill: '#4CAF50',
border: { width: 1, color: '#2E7D32' }
}
}}
>
{/* Series configuration */}
</RangeNavigatorComponent>Complete Thumb Customization Example
function App() {
const stockData = [
{ date: new Date(2023, 0, 1), price: 100 },
{ date: new Date(2023, 1, 1), price: 110 },
{ date: new Date(2023, 2, 1), price: 105 },
{ date: new Date(2023, 3, 1), price: 115 },
{ date: new Date(2023, 4, 1), price: 120 },
{ date: new Date(2023, 5, 1), price: 125 }
];
return (
<RangeNavigatorComponent
id="rangeNavigator"
valueType="DateTime"
labelFormat="MMM"
navigatorStyleSettings={{
selectedRegionColor: 'rgba(33, 150, 243, 0.3)',
unselectedRegionColor: 'transparent',
thumb: {
type: 'Circle',
width: 24,
height: 24,
fill: '#2196F3',
border: {
width: 3,
color: '#ffffff'
}
}
}}
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={stockData}
xName="date"
yName="price"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}Border Customization
Customize the border around the entire Range Navigator using the navigatorBorder property.
Border Properties
- width: Border width in pixels
- color: Border color
Basic Border Customization
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const data = [
{ x: new Date(2023, 0, 1), y: 100 },
{ x: new Date(2023, 1, 1), y: 110 },
{ x: new Date(2023, 2, 1), y: 105 },
{ x: new Date(2023, 3, 1), y: 115 }
];
return (
<RangeNavigatorComponent
id="rangeNavigator"
valueType="DateTime"
navigatorBorder={{
width: 2,
color: '#2196F3'
}}
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="x"
yName="y"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Border Styles
// Thin border
navigatorBorder={{ width: 1, color: '#CCCCCC' }}
// Medium border (default-like)
navigatorBorder={{ width: 2, color: '#2196F3' }}
// Thick border
navigatorBorder={{ width: 4, color: '#1976D2' }}
// No border
navigatorBorder={{ width: 0, color: 'transparent' }}Complete Border and Appearance Example
function App() {
const data = [
{ x: new Date(2023, 0, 1), y: 100 },
{ x: new Date(2023, 1, 1), y: 110 },
{ x: new Date(2023, 2, 1), y: 105 },
{ x: new Date(2023, 3, 1), y: 115 },
{ x: new Date(2023, 4, 1), y: 120 }
];
return (
<RangeNavigatorComponent
id="rangeNavigator"
valueType="DateTime"
navigatorBorder={{
width: 3,
color: '#2196F3'
}}
navigatorStyleSettings={{
selectedRegionColor: 'rgba(33, 150, 243, 0.3)',
unselectedRegionColor: 'transparent',
thumb: {
type: 'Rectangle',
width: 15,
height: 45,
fill: '#2196F3',
border: { width: 2, color: '#ffffff' }
}
}}
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="x"
yName="y"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}Deferred Update
The enableDeferredUpdate property controls when the changed event fires during thumb dragging.
Behavior
- false (default):
changedevent fires continuously while dragging - true:
changedevent fires only after dragging completes
Enable Deferred Update
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const data = [
{ x: new Date(2023, 0, 1), y: 100 },
{ x: new Date(2023, 1, 1), y: 110 },
{ x: new Date(2023, 2, 1), y: 105 },
{ x: new Date(2023, 3, 1), y: 115 }
];
const handleChange = (args) => {
console.log('Range changed:', args.start, args.end);
// This fires only after dragging completes when enableDeferredUpdate is true
};
return (
<RangeNavigatorComponent
id="rangeNavigator"
valueType="DateTime"
enableDeferredUpdate={true}
changed={handleChange}
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="x"
yName="y"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));When to Use Deferred Update
Use `enableDeferredUpdate={true}` when:
- Performing expensive operations on range change (API calls, heavy calculations)
- Updating large data grids or charts
- Network requests based on selected range
- Performance optimization is needed
Use `enableDeferredUpdate={false}` (default) when:
- Real-time updates are needed
- Simple UI updates
- Immediate feedback is important
- Operations are lightweight
Deferred Update with Data Grid Example
import { useState } from 'react';
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const [selectedRange, setSelectedRange] = useState({
start: new Date(2023, 0, 1),
end: new Date(2023, 5, 1)
});
const data = [
{ date: new Date(2023, 0, 1), value: 100 },
{ date: new Date(2023, 1, 1), value: 110 },
{ date: new Date(2023, 2, 1), value: 105 },
{ date: new Date(2023, 3, 1), value: 115 },
{ date: new Date(2023, 4, 1), value: 120 },
{ date: new Date(2023, 5, 1), value: 125 }
];
const handleRangeChange = (args) => {
setSelectedRange({
start: args.start,
end: args.end
});
// Fetch filtered data from API
// fetchData(args.start, args.end);
};
return (
<div>
<RangeNavigatorComponent
id="rangeNavigator"
valueType="DateTime"
enableDeferredUpdate={true}
changed={handleRangeChange}
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="date"
yName="value"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
<div>
<p>Selected Range:</p>
<p>Start: {selectedRange.start.toDateString()}</p>
<p>End: {selectedRange.end.toDateString()}</p>
</div>
</div>
);
}Allow Snapping
The allowSnapping property toggles whether the slider snaps exactly to the nearest interval.
Behavior
- false (default): Slider can be placed anywhere
- true: Slider snaps to nearest interval tick
Enable Snapping
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const data = [
{ x: new Date(2023, 0, 1), y: 100 },
{ x: new Date(2023, 1, 1), y: 110 },
{ x: new Date(2023, 2, 1), y: 105 },
{ x: new Date(2023, 3, 1), y: 115 },
{ x: new Date(2023, 4, 1), y: 120 },
{ x: new Date(2023, 5, 1), y: 125 }
];
return (
<RangeNavigatorComponent
id="rangeNavigator"
valueType="DateTime"
intervalType="Months"
allowSnapping={true}
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="x"
yName="y"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));When to Use Snapping
Use `allowSnapping={true}` when:
- Data points are at specific intervals (months, quarters, years)
- Precise alignment with data points is required
- Filtering by exact time periods
- Categorical or discrete data
Use `allowSnapping={false}` (default) when:
- Continuous data ranges
- Flexibility in range selection is needed
- Sub-interval precision is important
Snapping with Numeric Intervals
<RangeNavigatorComponent
valueType="Double"
minimum={0}
maximum={100}
interval={10}
allowSnapping={true}
>
{/* Slider snaps to 0, 10, 20, 30, ... 100 */}
</RangeNavigatorComponent>Animation Duration
Control the speed of Range Navigator animations using the animationDuration property.
Animation Duration Property
- Default: 500 milliseconds
- Range: 0 to any positive number
- Unit: Milliseconds
- 0: Disables animation
Custom Animation Duration
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const data = [
{ x: new Date(2023, 0, 1), y: 100 },
{ x: new Date(2023, 1, 1), y: 110 },
{ x: new Date(2023, 2, 1), y: 105 },
{ x: new Date(2023, 3, 1), y: 115 }
];
return (
<RangeNavigatorComponent
id="rangeNavigator"
valueType="DateTime"
animationDuration={1000}
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="x"
yName="y"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Animation Duration Examples
// No animation
animationDuration={0}
// Fast animation
animationDuration={200}
// Default animation
animationDuration={500}
// Slow animation
animationDuration={1000}
// Very slow animation
animationDuration={2000}When to Adjust Animation Duration
Use faster animations (200-300ms) when:
- Frequent user interactions expected
- Real-time data updates
- Performance is critical
Use default (500ms) when:
- Standard user experience desired
- Balanced performance and visual appeal
Use slower animations (800-1200ms) when:
- Emphasis on visual transitions
- Tutorial or demonstration mode
- Smooth, elegant transitions desired
Disable animations (0ms) when:
- Maximum performance needed
- Accessibility requirements (reduced motion)
- Testing or automation
Complete Customization Example
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const stockData = [
{ date: new Date(2023, 0, 1), price: 100 },
{ date: new Date(2023, 1, 1), price: 110 },
{ date: new Date(2023, 2, 1), price: 105 },
{ date: new Date(2023, 3, 1), price: 115 },
{ date: new Date(2023, 4, 1), price: 120 },
{ date: new Date(2023, 5, 1), price: 125 },
{ date: new Date(2023, 6, 1), price: 130 },
{ date: new Date(2023, 7, 1), price: 128 },
{ date: new Date(2023, 8, 1), price: 135 },
{ date: new Date(2023, 9, 1), price: 140 },
{ date: new Date(2023, 10, 1), price: 138 },
{ date: new Date(2023, 11, 1), price: 145 }
];
const handleRangeChange = (args) => {
console.log('Selected Range:', args.start, 'to', args.end);
};
return (
<RangeNavigatorComponent
id="rangeNavigator"
valueType="DateTime"
labelFormat="MMM"
value={[new Date(2023, 2, 1), new Date(2023, 9, 1)]}
// Appearance
navigatorStyleSettings={{
selectedRegionColor: 'rgba(33, 150, 243, 0.3)',
unselectedRegionColor: 'transparent',
thumb: {
type: 'Circle',
width: 24,
height: 24,
fill: '#2196F3',
border: { width: 3, color: '#ffffff' }
}
}}
navigatorBorder={{ width: 2, color: '#2196F3' }}
// Behavior
enableDeferredUpdate={true}
allowSnapping={true}
animationDuration={800}
// Event
changed={handleRangeChange}
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={stockData}
xName="date"
yName="price"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Customization Summary
| Feature | Property | Default | Options |
|---|---|---|---|
| Selected region color | navigatorStyleSettings.selectedRegionColor | Theme-based | Any color/rgba |
| Unselected region color | navigatorStyleSettings.unselectedRegionColor | transparent | Any color/rgba |
| Thumb shape | navigatorStyleSettings.thumb.type | Circle | Circle, Rectangle |
| Thumb size | navigatorStyleSettings.thumb.width/height | 15/15 | Any number |
| Border | navigatorBorder.width/color | 1/theme | Any number/color |
| Deferred update | enableDeferredUpdate | false | true, false |
| Snapping | allowSnapping | false | true, false |
| Animation speed | animationDuration | 500 | 0-any number (ms) |
API Links
Full Range Navigator API: https://ej2.syncfusion.com/react/documentation/api/range-navigator/index-default
Customization-specific complex API references:
- `navigatorStyleSettings` (selectedRegionColor, unselectedRegionColor, thumb: { type, width, height, fill, border })
- `navigatorBorder` (width, color)
- `enableDeferredUpdate`, `allowSnapping`, `animationDuration`, `allowIntervalData`
Data Binding and Value Types
The Range Navigator supports three value types for the axis: Numeric (Double), Logarithmic, and DateTime. Each value type is optimized for different data scenarios and provides specific configuration options.
Table of Contents
- Numeric Value Type
- Range Configuration
- Numeric Label Formatting
- Custom Label Format
- Logarithmic Axis
- Logarithmic Range
- Logarithmic Base
- DateTime Value Type
- DateTime Interval Customization
- DateTime Label Format
Numeric Value Type
The numeric scale represents numeric values in the Range Navigator. By default, the valueType is Double.
Basic Numeric Implementation
import {
RangeNavigatorComponent,
AreaSeries,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const data = [
{ x: 0, y: 10 },
{ x: 10, y: 30 },
{ x: 20, y: 25 },
{ x: 30, y: 45 },
{ x: 40, y: 35 },
{ x: 50, y: 55 },
{ x: 60, y: 50 }
];
return (
<RangeNavigatorComponent
id="rangeNavigator"
valueType="Double"
>
<Inject services={[AreaSeries]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="x"
yName="y"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Range Configuration
The minimum and maximum of the scale are calculated automatically based on the provided data. You can customize these values using the minimum, maximum, and interval properties.
Automatic Range
// Range is automatically calculated from data
const data = [
{ x: 0, y: 10 },
{ x: 100, y: 50 }
];
<RangeNavigatorComponent valueType="Double">
{/* Automatic range: 0 to 100 */}
</RangeNavigatorComponent>Custom Range
import {
RangeNavigatorComponent,
AreaSeries,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const data = [
{ x: 0, y: 10 },
{ x: 10, y: 30 },
{ x: 20, y: 25 },
{ x: 30, y: 45 },
{ x: 40, y: 35 },
{ x: 50, y: 55 }
];
return (
<RangeNavigatorComponent
id="rangeNavigator"
valueType="Double"
minimum={0}
maximum={60}
interval={10}
value={[10, 40]}
>
<Inject services={[AreaSeries]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="x"
yName="y"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Properties:
minimum: Minimum value of the axismaximum: Maximum value of the axisinterval: Spacing between axis labelsvalue: Initial selected range [start, end]
Numeric Label Formatting
Format numeric labels using the labelFormat property. It supports all globalized formats.
Standard Formats
// Number format with 1 decimal place
<RangeNavigatorComponent
valueType="Double"
labelFormat="n1"
>
{/* Labels: 1000.0, 2000.0, 3000.0 */}
</RangeNavigatorComponent>
// Percentage format
<RangeNavigatorComponent
valueType="Double"
labelFormat="p2"
>
{/* Labels: 1.00%, 2.00%, 3.00% */}
</RangeNavigatorComponent>
// Currency format
<RangeNavigatorComponent
valueType="Double"
labelFormat="c2"
>
{/* Labels: $1,000.00, $2,000.00, $3,000.00 */}
</RangeNavigatorComponent>Label Format Reference Table
| Label Value | Format | Result | Description |
|---|---|---|---|
| 1000 | n1 | 1000.0 | Number rounded to 1 decimal place |
| 1000 | n2 | 1000.00 | Number rounded to 2 decimal places |
| 1000 | n3 | 1000.000 | Number rounded to 3 decimal places |
| 0.01 | p1 | 1.0% | Percentage with 1 decimal place |
| 0.01 | p2 | 1.00% | Percentage with 2 decimal places |
| 0.01 | p3 | 1.000% | Percentage with 3 decimal places |
| 1000 | c1 | $1,000.0 | Currency with 1 decimal place |
| 1000 | c2 | $1,000.00 | Currency with 2 decimal places |
Complete Example with Formatting
function App() {
const salesData = [
{ month: 1, sales: 15000 },
{ month: 2, sales: 18000 },
{ month: 3, sales: 22000 },
{ month: 4, sales: 25000 },
{ month: 5, sales: 28000 },
{ month: 6, sales: 32000 }
];
return (
<RangeNavigatorComponent
valueType="Double"
minimum={0}
maximum={35000}
interval={5000}
labelFormat="c0"
>
<Inject services={[AreaSeries]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={salesData}
xName="month"
yName="sales"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}Custom Label Format
The Range Navigator supports custom label formats using placeholders like {value}$, where {value} represents the axis label value.
Custom Format Examples
// Append dollar sign
<RangeNavigatorComponent
valueType="Double"
labelFormat="{value}$"
>
{/* Labels: 10$, 20$, 30$ */}
</RangeNavigatorComponent>
// Prepend text
<RangeNavigatorComponent
valueType="Double"
labelFormat="Value: {value}"
>
{/* Labels: Value: 10, Value: 20, Value: 30 */}
</RangeNavigatorComponent>
// Custom currency
<RangeNavigatorComponent
valueType="Double"
labelFormat="₹{value}"
>
{/* Labels: ₹10, ₹20, ₹30 */}
</RangeNavigatorComponent>Complete Custom Format Example
function App() {
const data = [
{ x: 10, y: 100 },
{ x: 20, y: 150 },
{ x: 30, y: 120 },
{ x: 40, y: 180 },
{ x: 50, y: 200 }
];
return (
<RangeNavigatorComponent
valueType="Double"
labelFormat="{value}K Units"
minimum={0}
maximum={60}
interval={10}
>
<Inject services={[AreaSeries]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="x"
yName="y"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}Logarithmic Axis
The logarithmic scale visualizes data when the Range Navigator has numerical values in both lower (e.g., 10⁻⁶) and higher (e.g., 10⁶) orders of magnitude.
Module Injection Required
import { Logarithmic } from '@syncfusion/ej2-react-charts';
<Inject services={[LineSeries, Logarithmic]} />Basic Logarithmic Implementation
import {
RangeNavigatorComponent,
LineSeries,
Logarithmic,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const data = [
{ x: 1, y: 100 },
{ x: 2, y: 1000 },
{ x: 3, y: 10000 },
{ x: 4, y: 100000 },
{ x: 5, y: 1000000 }
];
return (
<RangeNavigatorComponent
valueType="Logarithmic"
>
<Inject services={[LineSeries, Logarithmic]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="x"
yName="y"
type="Line"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Key Points: 1. Set valueType="Logarithmic" 2. Inject the Logarithmic module 3. Suitable for data spanning multiple orders of magnitude
Logarithmic Range
Customize the minimum, maximum, and interval for logarithmic scales.
import {
RangeNavigatorComponent,
LineSeries,
Logarithmic,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const data = [
{ x: 1, y: 1000 },
{ x: 2, y: 10000 },
{ x: 3, y: 100000 },
{ x: 4, y: 1000000 }
];
return (
<RangeNavigatorComponent
valueType="Logarithmic"
minimum={100}
maximum={10000000}
interval={1}
>
<Inject services={[LineSeries, Logarithmic]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="x"
yName="y"
type="Line"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Properties:
minimum: Starting logarithmic value (e.g., 100 = 10²)maximum: Ending logarithmic value (e.g., 10000000 = 10⁷)interval: Number of powers between labels (1 = every power)
Logarithmic Base
Customize the logarithmic base using the logBase property. The default base is 10.
Custom Base Examples
// Base 10 (default)
<RangeNavigatorComponent
valueType="Logarithmic"
logBase={10}
>
{/* Labels: 10, 100, 1000, 10000 */}
</RangeNavigatorComponent>
// Base 2
<RangeNavigatorComponent
valueType="Logarithmic"
logBase={2}
>
{/* Labels: 2, 4, 8, 16, 32, 64 */}
</RangeNavigatorComponent>
// Base E (natural logarithm)
<RangeNavigatorComponent
valueType="Logarithmic"
logBase={Math.E}
>
{/* Labels: e, e², e³, e⁴ */}
</RangeNavigatorComponent>Complete Logarithmic Example
function App() {
const scientificData = [
{ x: 1, y: 10 },
{ x: 2, y: 100 },
{ x: 3, y: 1000 },
{ x: 4, y: 10000 },
{ x: 5, y: 100000 },
{ x: 6, y: 1000000 }
];
return (
<RangeNavigatorComponent
valueType="Logarithmic"
logBase={10}
minimum={1}
maximum={10000000}
interval={1}
>
<Inject services={[LineSeries, Logarithmic]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={scientificData}
xName="x"
yName="y"
type="Line"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}DateTime Value Type
The DateTime scale displays date and time values as labels in the specified format. This is ideal for time-series data.
Module Injection Required
import { DateTime } from '@syncfusion/ej2-react-charts';
<Inject services={[AreaSeries, DateTime]} />Basic DateTime Implementation
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const data = [
{ x: new Date(2018, 0, 1), y: 35 },
{ x: new Date(2018, 1, 1), y: 28 },
{ x: new Date(2018, 2, 1), y: 34 },
{ x: new Date(2018, 3, 1), y: 32 },
{ x: new Date(2018, 4, 1), y: 40 },
{ x: new Date(2018, 5, 1), y: 42 }
];
return (
<RangeNavigatorComponent
valueType="DateTime"
labelFormat="MMM"
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="x"
yName="y"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Key Points: 1. Set valueType="DateTime" 2. Inject the DateTime module 3. Use Date objects in your data array 4. Format labels with labelFormat
DateTime Interval Customization
Customize DateTime intervals using the interval and intervalType properties.
Available Interval Types
- Auto: Automatically determined
- Years: Yearly intervals
- Quarter: Quarterly intervals (3 months)
- Months: Monthly intervals
- Weeks: Weekly intervals
- Days: Daily intervals
- Hours: Hourly intervals
- Minutes: Minute intervals
- Seconds: Second intervals
Interval Examples
// Every 2 years
<RangeNavigatorComponent
valueType="DateTime"
interval={2}
intervalType="Years"
labelFormat="yyyy"
>
</RangeNavigatorComponent>
// Every 3 months
<RangeNavigatorComponent
valueType="DateTime"
interval={3}
intervalType="Months"
labelFormat="MMM yyyy"
>
</RangeNavigatorComponent>
// Every 7 days
<RangeNavigatorComponent
valueType="DateTime"
interval={7}
intervalType="Days"
labelFormat="dd MMM"
>
</RangeNavigatorComponent>Complete DateTime Interval Example
function App() {
const stockData = [
{ date: new Date(2020, 0, 1), price: 100 },
{ date: new Date(2020, 3, 1), price: 110 },
{ date: new Date(2020, 6, 1), price: 105 },
{ date: new Date(2020, 9, 1), price: 115 },
{ date: new Date(2021, 0, 1), price: 120 },
{ date: new Date(2021, 3, 1), price: 130 },
{ date: new Date(2021, 6, 1), price: 125 },
{ date: new Date(2021, 9, 1), price: 135 }
];
return (
<RangeNavigatorComponent
valueType="DateTime"
interval={3}
intervalType="Months"
labelFormat="MMM yyyy"
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={stockData}
xName="date"
yName="price"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}DateTime Label Format
Use the labelFormat property to format and parse dates using globalized formats.
Common DateTime Formats
// Display day name
<RangeNavigatorComponent labelFormat="EEEE">
{/* Monday, Tuesday, Wednesday */}
</RangeNavigatorComponent>
// Display month/day/year
<RangeNavigatorComponent labelFormat="yMd">
{/* 04/10/2000 */}
</RangeNavigatorComponent>
// Display month abbreviation
<RangeNavigatorComponent labelFormat="MMM">
{/* Jan, Feb, Mar */}
</RangeNavigatorComponent>
// Display time
<RangeNavigatorComponent labelFormat="hm">
{/* 12:00 AM, 1:30 PM */}
</RangeNavigatorComponent>DateTime Format Reference Table
| Label Value | Format | Result | Description |
|---|---|---|---|
| new Date(2000, 3, 10) | EEEE | Monday | Day name in full |
| new Date(2000, 3, 10) | yMd | 04/10/2000 | Month/date/year format |
| new Date(2000, 3, 10) | MMM | Apr | Month abbreviation |
| new Date(2000, 3, 10) | hm | 12:00 AM | Time in hours:minutes |
| new Date(2000, 3, 10) | hms | 12:00:00 AM | Time with seconds |
Complete DateTime Format Example
function App() {
const data = [
{ date: new Date(2023, 0, 1), value: 100 },
{ date: new Date(2023, 1, 1), value: 110 },
{ date: new Date(2023, 2, 1), value: 105 },
{ date: new Date(2023, 3, 1), value: 115 },
{ date: new Date(2023, 4, 1), value: 120 },
{ date: new Date(2023, 5, 1), value: 125 }
];
return (
<RangeNavigatorComponent
valueType="DateTime"
intervalType="Months"
labelFormat="MMM yyyy"
value={[new Date(2023, 0, 1), new Date(2023, 5, 1)]}
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="date"
yName="value"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}Data Binding Summary
Value Type Selection Guide
| Data Type | Use Case | Value Type | Module Required |
|---|---|---|---|
| Numbers | Sales, revenue, counts | Double | None (default) |
| Scientific data | 10⁻⁶ to 10⁶ range | Logarithmic | Logarithmic |
| Dates/Times | Time-series, historical | DateTime | DateTime |
Key Configuration Properties
- valueType: 'Double' | 'DateTime' | 'Logarithmic'
- minimum: Starting axis value
- maximum: Ending axis value
- interval: Spacing between labels
- intervalType: For DateTime (Years, Months, Days, etc.)
- labelFormat: Label display format
- logBase: Base for logarithmic scale (default: 10)
- value: Initial selected range [start, end]
API Links
Full Range Navigator API: https://ej2.syncfusion.com/react/documentation/api/range-navigator/index-default
Complex properties and related API references used above:
Export and Print
The Range Navigator component supports exporting to various image formats (PNG, JPEG, SVG, PDF) and printing functionality, allowing users to save or print the visualization for reports, presentations, or documentation.
Table of contents
- Export Formats
- Basic Export
- Export to PNG
- Export to JPEG
- Export to SVG
- Export to PDF
- Export with Custom Filename
- Print Functionality
- Basic Print
- Keyboard Shortcut for Print
- Multiple Export Options
- Export with Base64
- Export Events
- Format Comparison
- Browser Compatibility
- Export/Print Method Signatures
- Best Practices
- Common Use Cases
- Key Points
- API Links
Export Formats
The Range Navigator supports four export formats:
| Format | Extension | Use Case |
|---|---|---|
| PNG | .png | High-quality raster images with transparency support |
| JPEG | .jpeg/.jpg | Compressed raster images for smaller file sizes |
| SVG | .svg | Scalable vector graphics for infinite scaling |
| Portable document format for printing and sharing |
Basic Export
Export to PNG
import { useRef } from 'react';
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const rangeNavigatorRef = useRef(null);
const data = [
{ date: new Date(2023, 0, 1), value: 100 },
{ date: new Date(2023, 1, 1), value: 110 },
{ date: new Date(2023, 2, 1), value: 105 },
{ date: new Date(2023, 3, 1), value: 115 },
{ date: new Date(2023, 4, 1), value: 120 },
{ date: new Date(2023, 5, 1), value: 125 }
];
const handleExportPNG = () => {
if (rangeNavigatorRef.current) {
rangeNavigatorRef.current.export('PNG', 'RangeNavigator');
}
};
return (
<div>
<button onClick={handleExportPNG}>Export as PNG</button>
<RangeNavigatorComponent
ref={rangeNavigatorRef}
id="rangeNavigator"
valueType="DateTime"
labelFormat="MMM"
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="date"
yName="value"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
</div>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Export to JPEG
import { useRef } from 'react';
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const rangeNavigatorRef = useRef(null);
const data = [
{ date: new Date(2023, 0, 1), value: 100 },
{ date: new Date(2023, 1, 1), value: 110 },
{ date: new Date(2023, 2, 1), value: 105 },
{ date: new Date(2023, 3, 1), value: 115 }
];
const handleExportJPEG = () => {
if (rangeNavigatorRef.current) {
rangeNavigatorRef.current.export('JPEG', 'RangeNavigator');
}
};
return (
<div>
<button onClick={handleExportJPEG}>Export as JPEG</button>
<RangeNavigatorComponent
ref={rangeNavigatorRef}
id="rangeNavigator"
valueType="DateTime"
labelFormat="MMM"
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="date"
yName="value"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
</div>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Export to SVG
import { useRef } from 'react';
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const rangeNavigatorRef = useRef(null);
const data = [
{ date: new Date(2023, 0, 1), value: 100 },
{ date: new Date(2023, 1, 1), value: 110 },
{ date: new Date(2023, 2, 1), value: 105 },
{ date: new Date(2023, 3, 1), value: 115 }
];
const handleExportSVG = () => {
if (rangeNavigatorRef.current) {
rangeNavigatorRef.current.export('SVG', 'RangeNavigator');
}
};
return (
<div>
<button onClick={handleExportSVG}>Export as SVG</button>
<RangeNavigatorComponent
ref={rangeNavigatorRef}
id="rangeNavigator"
valueType="DateTime"
labelFormat="MMM"
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="date"
yName="value"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
</div>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Export to PDF
import { useRef } from 'react';
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const rangeNavigatorRef = useRef(null);
const data = [
{ date: new Date(2023, 0, 1), value: 100 },
{ date: new Date(2023, 1, 1), value: 110 },
{ date: new Date(2023, 2, 1), value: 105 },
{ date: new Date(2023, 3, 1), value: 115 }
];
const handleExportPDF = () => {
if (rangeNavigatorRef.current) {
rangeNavigatorRef.current.export('PDF', 'RangeNavigator');
}
};
return (
<div>
<button onClick={handleExportPDF}>Export as PDF</button>
<RangeNavigatorComponent
ref={rangeNavigatorRef}
id="rangeNavigator"
valueType="DateTime"
labelFormat="MMM"
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="date"
yName="value"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
</div>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Export with Custom Filename
Specify a custom filename when exporting:
import { useRef } from 'react';
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const rangeNavigatorRef = useRef(null);
const data = [
{ date: new Date(2023, 0, 1), value: 100 },
{ date: new Date(2023, 1, 1), value: 110 },
{ date: new Date(2023, 2, 1), value: 105 },
{ date: new Date(2023, 3, 1), value: 115 }
];
const handleExport = (format: 'PNG' | 'JPEG' | 'SVG' | 'PDF') => {
if (rangeNavigatorRef.current) {
const timestamp = new Date().toISOString().split('T')[0];
const filename = `Sales_Report_${timestamp}`;
rangeNavigatorRef.current.export(format, filename);
}
};
return (
<div>
<button onClick={() => handleExport('PNG')}>Export PNG</button>
<button onClick={() => handleExport('JPEG')}>Export JPEG</button>
<button onClick={() => handleExport('SVG')}>Export SVG</button>
<button onClick={() => handleExport('PDF')}>Export PDF</button>
<RangeNavigatorComponent
ref={rangeNavigatorRef}
id="rangeNavigator"
valueType="DateTime"
labelFormat="MMM"
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="date"
yName="value"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
</div>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Print Functionality
Basic Print
import { useRef } from 'react';
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const rangeNavigatorRef = useRef(null);
const data = [
{ date: new Date(2023, 0, 1), value: 100 },
{ date: new Date(2023, 1, 1), value: 110 },
{ date: new Date(2023, 2, 1), value: 105 },
{ date: new Date(2023, 3, 1), value: 115 }
];
const handlePrint = () => {
if (rangeNavigatorRef.current) {
rangeNavigatorRef.current.print();
}
};
return (
<div>
<button onClick={handlePrint}>Print</button>
<RangeNavigatorComponent
ref={rangeNavigatorRef}
id="rangeNavigator"
valueType="DateTime"
labelFormat="MMM"
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="date"
yName="value"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
</div>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Keyboard Shortcut for Print
Print using keyboard shortcut (Ctrl+P):
import { useRef, useEffect } from 'react';
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const rangeNavigatorRef = useRef(null);
const data = [
{ date: new Date(2023, 0, 1), value: 100 },
{ date: new Date(2023, 1, 1), value: 110 },
{ date: new Date(2023, 2, 1), value: 105 },
{ date: new Date(2023, 3, 1), value: 115 }
];
useEffect(() => {
const handleKeyPress = (event: KeyboardEvent) => {
if (event.ctrlKey && event.key === 'p') {
event.preventDefault();
if (rangeNavigatorRef.current) {
rangeNavigatorRef.current.print();
}
}
};
document.addEventListener('keydown', handleKeyPress);
return () => {
document.removeEventListener('keydown', handleKeyPress);
};
}, []);
const handlePrint = () => {
if (rangeNavigatorRef.current) {
rangeNavigatorRef.current.print();
}
};
return (
<div>
<button onClick={handlePrint}>Print (or press Ctrl+P)</button>
<RangeNavigatorComponent
ref={rangeNavigatorRef}
id="rangeNavigator"
valueType="DateTime"
labelFormat="MMM"
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="date"
yName="value"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
</div>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Multiple Export Options
Provide multiple export formats:
import { useRef } from 'react';
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
RangeTooltip,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const rangeNavigatorRef = useRef(null);
const data = [
{ date: new Date(2023, 0, 1), value: 100 },
{ date: new Date(2023, 1, 1), value: 110 },
{ date: new Date(2023, 2, 1), value: 105 },
{ date: new Date(2023, 3, 1), value: 115 },
{ date: new Date(2023, 4, 1), value: 120 },
{ date: new Date(2023, 5, 1), value: 125 }
];
const handleExport = (format: 'PNG' | 'JPEG' | 'SVG' | 'PDF') => {
if (rangeNavigatorRef.current) {
rangeNavigatorRef.current.export(format, 'RangeNavigator');
}
};
const handlePrint = () => {
if (rangeNavigatorRef.current) {
rangeNavigatorRef.current.print();
}
};
return (
<div>
<div style={{ marginBottom: '10px' }}>
<button onClick={() => handleExport('PNG')}>📷 PNG</button>
<button onClick={() => handleExport('JPEG')}>🖼️ JPEG</button>
<button onClick={() => handleExport('SVG')}>📐 SVG</button>
<button onClick={() => handleExport('PDF')}>📄 PDF</button>
<button onClick={handlePrint}>🖨️ Print</button>
</div>
<RangeNavigatorComponent
ref={rangeNavigatorRef}
id="rangeNavigator"
valueType="DateTime"
labelFormat="MMM yyyy"
tooltip={{ enable: true }}
>
<Inject services={[AreaSeries, DateTime, RangeTooltip ]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="date"
yName="value"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
</div>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Export with Base64
Export as Base64 string for embedding or further processing:
import { useRef, useState } from 'react';
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const rangeNavigatorRef = useRef(null);
const [base64Image, setBase64Image] = useState('');
const data = [
{ date: new Date(2023, 0, 1), value: 100 },
{ date: new Date(2023, 1, 1), value: 110 },
{ date: new Date(2023, 2, 1), value: 105 },
{ date: new Date(2023, 3, 1), value: 115 }
];
const handleExportBase64 = () => {
if (rangeNavigatorRef.current) {
// Export and get Base64 string
const base64 = rangeNavigatorRef.current.export('PNG', 'RangeNavigator', null, true);
// The Base64 string is returned when the 4th parameter is true
console.log('Base64:', base64);
setBase64Image(base64);
}
};
return (
<div>
<button onClick={handleExportBase64}>Export as Base64</button>
<RangeNavigatorComponent
ref={rangeNavigatorRef}
id="rangeNavigator"
valueType="DateTime"
labelFormat="MMM"
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="date"
yName="value"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
{base64Image && (
<div style={{ marginTop: '20px' }}>
<h3>Base64 Preview:</h3>
<img
src={base64Image}
alt="Exported Range Navigator"
style={{ maxWidth: '100%' }}
/>
</div>
)}
</div>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Export Events
Handle export before and after events:
import { useRef } from 'react';
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective,
IBeforeExportEventArgs,
IAfterExportEventArgs
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const rangeNavigatorRef = useRef(null);
const data = [
{ date: new Date(2023, 0, 1), value: 100 },
{ date: new Date(2023, 1, 1), value: 110 },
{ date: new Date(2023, 2, 1), value: 105 },
{ date: new Date(2023, 3, 1), value: 115 }
];
const handleExport = () => {
if (rangeNavigatorRef.current) {
rangeNavigatorRef.current.export('PNG', 'RangeNavigator');
}
};
const beforeExport = (args: IBeforeExportEventArgs) => {
console.log('Before Export:', args);
// You can modify export settings here
};
const afterExport = (args: IAfterExportEventArgs) => {
console.log('After Export:', args);
// Perform actions after export completes
};
return (
<div>
<button onClick={handleExport}>Export</button>
<RangeNavigatorComponent
ref={rangeNavigatorRef}
id="rangeNavigator"
valueType="DateTime"
labelFormat="MMM"
beforeExport={beforeExport}
afterExport={afterExport}
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="date"
yName="value"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
</div>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Format Comparison
| Format | Best For | File Size | Quality | Scalability |
|---|---|---|---|---|
| PNG | Web, presentations, transparency | Medium | High | Fixed resolution |
| JPEG | Photos, compressed images | Small | Good | Fixed resolution |
| SVG | Print, infinite scaling | Small | Perfect | Infinite |
| Reports, documents, printing | Medium | High | High |
Browser Compatibility
Export and print features are supported in:
- Chrome
- Firefox
- Safari
- Edge
- Opera
When to Use Each Format
PNG
- Web applications
- Presentations
- Need transparency support
- High-quality raster images
JPEG
- Email attachments (smaller file size)
- Compressed storage
- No transparency needed
SVG
- Print materials
- Responsive web design
- Infinite scaling needed
- Smallest file size for vector graphics
- Reports and documentation
- Professional printing
- Multi-page documents
- Archival purposes
Export Method Signature
export(
type: 'PNG' | 'JPEG' | 'SVG' | 'PDF',
fileName: string,
orientation?: 'Portrait' | 'Landscape',
controls?: RangeNavigatorComponent[],
width?: number,
height?: number,
isVertical?: boolean
): voidPrint Method Signature
print(id?: string | string[]): voidBest Practices
1. Filename Convention: Use descriptive names with timestamps 2. Format Selection: Choose based on use case (see comparison table) 3. Quality: PNG/PDF for high quality, JPEG for smaller size 4. User Choice: Provide multiple export options 5. Feedback: Show success/error messages after export 6. Accessibility: Include keyboard shortcuts (Ctrl+P) 7. Ref Management: Always use refs to access export methods
Common Use Cases
Report Generation
// Export as PDF for reports
rangeNavigatorRef.current.export('PDF', 'Monthly_Sales_Report');Web Sharing
// Export as PNG for web sharing
rangeNavigatorRef.current.export('PNG', 'Range_Chart');High-Quality Print
// Export as SVG for print
rangeNavigatorRef.current.export('SVG', 'Print_Ready_Chart');Email Attachment
// Export as JPEG for smaller size
rangeNavigatorRef.current.export('JPEG', 'Chart_Summary');Key Points
1. Four Formats: PNG, JPEG, SVG, PDF support 2. Easy Export: Simple export() method with format and filename 3. Print Support: Built-in print() method 4. Custom Filenames: Specify names for exported files 5. Base64 Export: Option to export as Base64 string 6. Events: beforeExport and afterExport event handlers 7. Keyboard Support: Ctrl+P for printing 8. Ref Required: Use React refs to access export/print methods 9. Format Selection: Choose based on use case and requirements 10. Browser Compatible: Works across all modern browsers
API Links
Full Range Navigator API: https://ej2.syncfusion.com/react/documentation/api/range-navigator/index-default
Export/print complex API references:
- Methods: `export(type, fileName, orientation, controls, width, height, isVertical)`, `print(id)`
- Events: `beforeExport` and `afterExport`
- Notes: use a React
refto call export/print methods on the component instance
Getting Started with Range Navigator
This guide covers everything you need to know to install, configure, and create your first Range Navigator component in a React application.
Table of contents
- Dependencies
- Installation and Configuration
- Option 1: Using Vite (Recommended)
- Option 2: Using Create React App
- Add Range Navigator to the Project
- Import and Add Component
- Update Main Entry File
- Basic Range Navigator Implementation
- Module Injection
- Available Modules
- How to Inject Modules
- Populating Range Navigator with Data
- Prepare Data
- Configure Series
- Value Type Configuration
- Enable Tooltip
- Add CSS Stylesheets
- Complete Example
- License Registration
- Key Points to Remember
- Next Steps
- API Links
Dependencies
The Range Navigator component requires the following Syncfusion packages:
|-- @syncfusion/ej2-react-charts
|-- @syncfusion/ej2-base
|-- @syncfusion/ej2-data
|-- @syncfusion/ej2-pdf-export
|-- @syncfusion/ej2-file-utils
|-- @syncfusion/ej2-compression
|-- @syncfusion/ej2-navigations
|-- @syncfusion/ej2-calendars
|-- @syncfusion/ej2-svg-baseInstallation and Configuration
Option 1: Using Vite (Recommended)
Vite provides a faster development environment with smaller bundle sizes and optimized builds.
Step 1: Create a new React application
npm create vite@latest my-appThis command will prompt you to select a framework and variant.
For TypeScript:
npm create vite@latest my-app -- --template react-ts
cd my-app
npm run devFor JavaScript:
npm create vite@latest my-app -- --template react
cd my-app
npm run devStep 2: Install Syncfusion Range Navigator package
All Syncfusion Essential JS 2 packages are published on npmjs.com. Install the package using:
npm install @syncfusion/ej2-react-charts --saveThe --save flag adds the Range Navigator package to the dependencies section in package.json.
Option 2: Using Create React App
If you prefer Create React App, you can follow the traditional CRA setup process and install the same @syncfusion/ej2-react-charts package.
Add Range Navigator to the Project
Step 1: Import and Add Component
Add the Range Navigator component to src/App.tsx (or src/App.jsx for JavaScript):
TypeScript Example:
import * as React from 'react';
import { RangeNavigatorComponent } from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
function App() {
return (<RangeNavigatorComponent></RangeNavigatorComponent>);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Step 2: Update Main Entry File
Update src/main.tsx (or src/main.jsx) to render the App component using React 18's createRoot API:
import React from 'react';
import { createRoot } from 'react-dom/client';
import App from './App';
import './index.css';
const root = createRoot(document.getElementById('root')!);
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);Step 3: Run the Development Server
npm run devThis compiles your code and serves the application locally in the browser.
Basic Range Navigator Implementation
Here's a basic Range Navigator without any data:
import * as React from 'react';
import { RangeNavigatorComponent } from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
function App() {
return (
<RangeNavigatorComponent
id="rangeNavigator"
valueType="Double"
>
</RangeNavigatorComponent>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Module Injection
Range Navigator components are segregated into individual feature-wise modules. To use a particular feature, inject its feature service in the component.
Available Modules
- AreaSeries - Use area series for data visualization
- LineSeries - Use line series for data visualization
- StepLineSeries - Use step line series for data visualization
- DateTime - Use DateTime axis for time-series data
- Logarithmic - Use logarithmic scale for magnitude data
- RangeTooltip - Display tooltips on slider interaction
- PeriodSelector - Add predefined time period buttons
How to Inject Modules
Import the required modules from the chart package and inject them using the Inject component:
// src/App.tsx
import * as React from 'react';
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
RangeTooltip,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
function App() {
return (
<RangeNavigatorComponent id="charts">
<Inject services={[AreaSeries, DateTime, RangeTooltip ]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
// placeholder until data is bound
dataSource={[]}
xName="x"
yName="y"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Populating Range Navigator with Data
Step 1: Prepare Data
Create a data array with x and y values:
const data = [
{ x: new Date(2018, 0, 1), y: 35 },
{ x: new Date(2018, 1, 1), y: 28 },
{ x: new Date(2018, 2, 1), y: 34 },
{ x: new Date(2018, 3, 1), y: 32 },
{ x: new Date(2018, 4, 1), y: 40 },
{ x: new Date(2018, 5, 1), y: 42 },
{ x: new Date(2018, 6, 1), y: 38 }
];Step 2: Configure Series
Add a series object to the Range Navigator using the SeriesCollectionDirective. Map the JSON fields to series properties:
- dataSource: JSON array with data
- xName: Field name for x-axis values
- yName: Field name for y-axis values
- type: Series type (Line, Area, StepLine)
// src/App.tsx
import * as React from 'react';
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
function App() {
const data = [
{ x: new Date(2018, 0, 1), y: 35 },
{ x: new Date(2018, 1, 1), y: 28 },
{ x: new Date(2018, 2, 1), y: 34 },
{ x: new Date(2018, 3, 1), y: 32 },
{ x: new Date(2018, 4, 1), y: 40 }
];
return (
<RangeNavigatorComponent
id="rangeNavigator"
valueType="DateTime"
labelFormat="MMM"
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="x"
yName="y"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Value Type Configuration
Since the JSON contains DateTime data, set the valueType property to 'DateTime'. Available value types:
- Double (default): Numeric values
- DateTime: Date/time values
- Logarithmic: Logarithmic scale
For category data, you would use numeric values with appropriate formatting.
Enable Tooltip
Tooltips display the selected start and end values when users interact with the range sliders.
Step 1: Inject RangeTooltip Module
import { RangeTooltip } from '@syncfusion/ej2-react-charts';
<Inject services={[AreaSeries, DateTime, RangeTooltip ]} />Step 2: Enable Tooltip
Set the enable property to true in the tooltip object:
// src/App.tsx
import * as React from 'react';
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
RangeTooltip,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
function App() {
const data = [
{ x: new Date(2018, 0, 1), y: 35 },
{ x: new Date(2018, 1, 1), y: 28 },
{ x: new Date(2018, 2, 1), y: 34 },
{ x: new Date(2018, 3, 1), y: 32 },
{ x: new Date(2018, 4, 1), y: 40 },
{ x: new Date(2018, 5, 1), y: 42 }
];
return (
<RangeNavigatorComponent
id="rangeNavigator"
valueType="DateTime"
labelFormat="MMM"
tooltip={{ enable: true }}
>
<Inject services={[AreaSeries, DateTime, RangeTooltip ]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="x"
yName="y"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Theme Customization
Available themes (18+ including dark & high contrast):
- Material, MaterialDark, Material3, Material3Dark
- Fabric, FabricDark
- Bootstrap, BootstrapDark, Bootstrap4, Bootstrap5, Bootstrap5Dark, Bootstrap5.3, Bootstrap5.3Dark
- Tailwind, TailwindDark
- Fluent, FluentDark, Fluent2, Fluent2Dark, Fluent2HighContrast
- HighContrast, HighContrastLight
Switch via the theme prop:
<RangeNavigatorComponent theme='Material3Dark'>
{/* Range Navigator content */}
</RangeNavigatorComponent>Complete Example
Here's a complete working example with all the pieces together:
// src/App.tsx
import * as React from 'react';
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
RangeTooltip,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
function App() {
const data = [
{ x: new Date(2018, 0, 1), y: 35 },
{ x: new Date(2018, 1, 1), y: 28 },
{ x: new Date(2018, 2, 1), y: 34 },
{ x: new Date(2018, 3, 1), y: 32 },
{ x: new Date(2018, 4, 1), y: 40 },
{ x: new Date(2018, 5, 1), y: 42 },
{ x: new Date(2018, 6, 1), y: 38 },
{ x: new Date(2018, 7, 1), y: 45 },
{ x: new Date(2018, 8, 1), y: 43 },
{ x: new Date(2018, 9, 1), y: 46 },
{ x: new Date(2018, 10, 1), y: 48 },
{ x: new Date(2018, 11, 1), y: 50 }
];
return (
<div className="App">
<RangeNavigatorComponent
id="rangeNavigator"
valueType="DateTime"
labelFormat="MMM"
value={[new Date(2018, 1, 1), new Date(2018, 6, 1)]}
tooltip={{ enable: true }}
>
<Inject services={[AreaSeries, DateTime, RangeTooltip ]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="x"
yName="y"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
</div>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));License Registration
For production applications, register your Syncfusion license key:
import { registerLicense } from '@syncfusion/ej2-base';
registerLicense('YOUR_LICENSE_KEY');Place this at the top of your application before any Syncfusion component is rendered. You can obtain a license key from the Syncfusion website.
Key Points to Remember
1. Install Package: npm install @syncfusion/ej2-react-charts 2. Import CSS: Add theme CSS file for styling 3. Inject Modules: Use <Inject services={[...]} /> for required features 4. Set Value Type: Configure valueType based on your data (Double, DateTime, Logarithmic) 5. Configure Series: Map data fields using dataSource, xName, yName 6. Enable Features: Configure tooltip, period selector, etc. as needed 7. Register License: Use registerLicense() for production
Next Steps
- Configure data binding with numeric, logarithmic, or DateTime data
- Customize series types (Line, Area, StepLine)
- Add period selector for predefined time ranges
- Customize appearance (colors, thumbs, borders)
- Enable tooltips with custom formatting
- Configure labels and grid/tick lines
API Links
Full Range Navigator API: https://ej2.syncfusion.com/react/documentation/api/range-navigator/index-default
Complex items referenced in this guide (see API for details):
Grid Lines and Tick Lines
Grid lines and tick lines provide visual reference points on the Range Navigator axis. Grid lines help users identify axis divisions, while tick lines mark the axis labels. Both can be customized extensively.
Table of contents
- Grid Line Customization
- Grid Line Properties
- Basic Grid Line Customization
- Grid Line Styles
- Solid Grid Lines
- Dashed Grid Lines
- Dotted Grid Lines
- Long Dash Grid Lines
- Thick Grid Lines
- No Grid Lines
- Tick Line Customization
- Tick Line Properties
- Combining Grid and Tick Lines
- Complete Example with Both Customizations
- Numeric Axis Grid and Tick Lines
- Themed Grid and Tick Lines
- Interactive Example with Style Switching
- Configuration Summary
- API Links
- Best Practices
Grid Line Customization
Gridlines are horizontal or vertical lines that indicate axis divisions, helping users interpret data values more accurately.
Grid Line Properties
Configure gridlines using the majorGridLines property:
- width: Line thickness in pixels
- color: Line color
- dashArray: Dash pattern (e.g., '5,3' for dashed line)
Basic Grid Line Customization
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const data = [
{ date: new Date(2023, 0, 1), value: 100 },
{ date: new Date(2023, 1, 1), value: 110 },
{ date: new Date(2023, 2, 1), value: 105 },
{ date: new Date(2023, 3, 1), value: 115 },
{ date: new Date(2023, 4, 1), value: 120 },
{ date: new Date(2023, 5, 1), value: 125 }
];
return (
<RangeNavigatorComponent
id="rangeNavigator"
valueType="DateTime"
labelFormat="MMM"
majorGridLines={{
width: 1,
color: '#E0E0E0',
dashArray: '0'
}}
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="date"
yName="value"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Grid Line Styles
Solid Grid Lines
majorGridLines={{
width: 1,
color: '#CCCCCC',
dashArray: '0'
}}Dashed Grid Lines
majorGridLines={{
width: 1,
color: '#CCCCCC',
dashArray: '5,5' // 5px dash, 5px gap
}}Dotted Grid Lines
majorGridLines={{
width: 1,
color: '#CCCCCC',
dashArray: '2,2' // 2px dash, 2px gap
}}Long Dash Grid Lines
majorGridLines={{
width: 1,
color: '#CCCCCC',
dashArray: '10,5' // 10px dash, 5px gap
}}Thick Grid Lines
majorGridLines={{
width: 2,
color: '#999999',
dashArray: '0'
}}No Grid Lines
majorGridLines={{
width: 0
}}DashArray Pattern Examples
The dashArray property accepts a string of numbers representing dash and gap lengths:
// Pattern format: 'dash,gap,dash,gap,...'
'5,5' // Simple dashed: 5px dash, 5px gap
'10,5' // Long dash: 10px dash, 5px gap
'2,2' // Dotted: 2px dash, 2px gap
'5,5,1,5' // Dash-dot: 5px dash, 5px gap, 1px dot, 5px gap
'10,5,5,5' // Dash-dash: 10px dash, 5px gap, 5px dash, 5px gap
'0' // Solid line (no dashes)Complete Grid Line Example
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const salesData = [
{ month: new Date(2023, 0, 1), sales: 15000 },
{ month: new Date(2023, 1, 1), sales: 18000 },
{ month: new Date(2023, 2, 1), sales: 22000 },
{ month: new Date(2023, 3, 1), sales: 25000 },
{ month: new Date(2023, 4, 1), sales: 28000 },
{ month: new Date(2023, 5, 1), sales: 32000 }
];
return (
<RangeNavigatorComponent
id="rangeNavigator"
valueType="DateTime"
labelFormat="MMM"
intervalType="Months"
majorGridLines={{
width: 1.5,
color: '#BDBDBD',
dashArray: '5,3'
}}
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={salesData}
xName="month"
yName="sales"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Tick Line Customization
Ticklines are small lines drawn on the axis representing axis labels. By default, tick lines are drawn outside the axis.
Tick Line Properties
Configure tick lines using the majorTickLines property:
- width: Line thickness in pixels
- color: Line color
- dashArray: Dash pattern
Basic Tick Line Customization
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const data = [
{ date: new Date(2023, 0, 1), value: 100 },
{ date: new Date(2023, 1, 1), value: 110 },
{ date: new Date(2023, 2, 1), value: 105 },
{ date: new Date(2023, 3, 1), value: 115 },
{ date: new Date(2023, 4, 1), value: 120 },
{ date: new Date(2023, 5, 1), value: 125 }
];
return (
<RangeNavigatorComponent
id="rangeNavigator"
valueType="DateTime"
labelFormat="MMM"
majorTickLines={{
width: 2,
color: '#2196F3',
dashArray: '0'
}}
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="date"
yName="value"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Tick Line Styles
Standard Tick Lines
majorTickLines={{
width: 1,
color: '#666666',
dashArray: '0'
}}Bold Tick Lines
majorTickLines={{
width: 3,
color: '#333333',
dashArray: '0'
}}Colored Tick Lines
majorTickLines={{
width: 2,
color: '#2196F3',
dashArray: '0'
}}Dashed Tick Lines
majorTickLines={{
width: 1,
color: '#666666',
dashArray: '3,3'
}}No Tick Lines
majorTickLines={{
width: 0
}}Combining Grid and Tick Lines
Coordinate grid and tick line styles for a cohesive appearance:
Subtle Grid with Prominent Ticks
<RangeNavigatorComponent
majorGridLines={{
width: 1,
color: '#E0E0E0',
dashArray: '2,2'
}}
majorTickLines={{
width: 2,
color: '#333333',
dashArray: '0'
}}
>
{/* Series configuration */}
</RangeNavigatorComponent>Prominent Grid with Subtle Ticks
<RangeNavigatorComponent
majorGridLines={{
width: 2,
color: '#BDBDBD',
dashArray: '0'
}}
majorTickLines={{
width: 1,
color: '#E0E0E0',
dashArray: '0'
}}
>
{/* Series configuration */}
</RangeNavigatorComponent>Matching Styles
<RangeNavigatorComponent
majorGridLines={{
width: 1,
color: '#2196F3',
dashArray: '5,5'
}}
majorTickLines={{
width: 1,
color: '#2196F3',
dashArray: '5,5'
}}
>
{/* Series configuration */}
</RangeNavigatorComponent>Minimal Style (No Lines)
<RangeNavigatorComponent
majorGridLines={{ width: 0 }}
majorTickLines={{ width: 0 }}
>
{/* Series configuration */}
</RangeNavigatorComponent>Complete Example with Both Customizations
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
RangeTooltip,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const data = [
{ date: new Date(2023, 0, 1), value: 100 },
{ date: new Date(2023, 1, 1), value: 110 },
{ date: new Date(2023, 2, 1), value: 105 },
{ date: new Date(2023, 3, 1), value: 115 },
{ date: new Date(2023, 4, 1), value: 120 },
{ date: new Date(2023, 5, 1), value: 125 },
{ date: new Date(2023, 6, 1), value: 130 },
{ date: new Date(2023, 7, 1), value: 128 },
{ date: new Date(2023, 8, 1), value: 135 },
{ date: new Date(2023, 9, 1), value: 140 },
{ date: new Date(2023, 10, 1), value: 138 },
{ date: new Date(2023, 11, 1), value: 145 }
];
return (
<div className="App">
<h2>Range Navigator with Custom Grid and Tick Lines</h2>
<RangeNavigatorComponent
id="rangeNavigator"
valueType="DateTime"
labelFormat="MMM"
value={[new Date(2023, 2, 1), new Date(2023, 9, 1)]}
tooltip={{ enable: true }}
// Grid line customization
majorGridLines={{
width: 1.5,
color: '#BDBDBD',
dashArray: '5,3'
}}
// Tick line customization
majorTickLines={{
width: 2,
color: '#2196F3',
dashArray: '0'
}}
>
<Inject services={[AreaSeries, DateTime, RangeTooltip ]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="date"
yName="value"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
</div>
);
}
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Numeric Axis Grid and Tick Lines
import {
RangeNavigatorComponent,
AreaSeries,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const data = [
{ x: 0, y: 10 },
{ x: 10, y: 30 },
{ x: 20, y: 25 },
{ x: 30, y: 45 },
{ x: 40, y: 35 },
{ x: 50, y: 55 }
];
return (
<RangeNavigatorComponent
id="rangeNavigator"
valueType="Double"
interval={10}
majorGridLines={{
width: 1,
color: '#E0E0E0',
dashArray: '0'
}}
majorTickLines={{
width: 2,
color: '#666666',
dashArray: '0'
}}
>
<Inject services={[AreaSeries]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="x"
yName="y"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
);
};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Themed Grid and Tick Lines
Match grid and tick lines to your application theme:
Material Theme Style
majorGridLines={{
width: 1,
color: '#E0E0E0',
dashArray: '0'
}}
majorTickLines={{
width: 1,
color: '#757575',
dashArray: '0'
}}Dark Theme Style
majorGridLines={{
width: 1,
color: '#424242',
dashArray: '0'
}}
majorTickLines={{
width: 2,
color: '#BDBDBD',
dashArray: '0'
}}Fluent Theme Style
majorGridLines={{
width: 1,
color: '#EDEBE9',
dashArray: '0'
}}
majorTickLines={{
width: 1,
color: '#605E5C',
dashArray: '0'
}}Interactive Example with Style Switching
import { useState } from 'react';
import {
RangeNavigatorComponent,
AreaSeries,
DateTime,
Inject,
RangenavigatorSeriesCollectionDirective,
RangenavigatorSeriesDirective
} from '@syncfusion/ej2-react-charts';
import * as ReactDOM from "react-dom";
import * as React from 'react';
function App() {
const [gridStyle, setGridStyle] = useState('default');
const data = [
{ date: new Date(2023, 0, 1), value: 100 },
{ date: new Date(2023, 1, 1), value: 110 },
{ date: new Date(2023, 2, 1), value: 105 },
{ date: new Date(2023, 3, 1), value: 115 }
];
const gridStyles = {
default: {
grid: { width: 1, color: '#E0E0E0', dashArray: '0' },
tick: { width: 1, color: '#666666', dashArray: '0' }
},
dashed: {
grid: { width: 1, color: '#BDBDBD', dashArray: '5,5' },
tick: { width: 2, color: '#2196F3', dashArray: '0' }
},
minimal: {
grid: { width: 0 },
tick: { width: 0 }
},
bold: {
grid: { width: 2, color: '#999999', dashArray: '0' },
tick: { width: 3, color: '#333333', dashArray: '0' }
}
};
return (
<div>
<div>
<button onClick={() => setGridStyle('default')}>Default</button>
<button onClick={() => setGridStyle('dashed')}>Dashed</button>
<button onClick={() => setGridStyle('minimal')}>Minimal</button>
<button onClick={() => setGridStyle('bold')}>Bold</button>
</div>
<RangeNavigatorComponent
id="rangeNavigator"
valueType="DateTime"
labelFormat="MMM"
majorGridLines={gridStyles[gridStyle].grid}
majorTickLines={gridStyles[gridStyle].tick}
>
<Inject services={[AreaSeries, DateTime]} />
<RangenavigatorSeriesCollectionDirective>
<RangenavigatorSeriesDirective
dataSource={data}
xName="date"
yName="value"
type="Area"
/>
</RangenavigatorSeriesCollectionDirective>
</RangeNavigatorComponent>
</div>
);
};
export default App;
ReactDOM.render(<App />, document.getElementById("charts"));Configuration Summary
Major Grid Lines Properties
| Property | Type | Default | Description |
|---|---|---|---|
| width | Number | 1 | Line thickness in pixels |
| color | String | '#E0E0E0' | Line color |
| dashArray | String | '0' | Dash pattern (e.g., '5,3') |
Major Tick Lines Properties
| Property | Type | Default | Description |
|---|---|---|---|
| width | Number | 1 | Line thickness in pixels |
| color | String | '#666666' | Line color |
| dashArray | String | '0' | Dash pattern (e.g., '5,3') |
API Links
Full Range Navigator API: https://ej2.syncfusion.com/react/documentation/api/range-navigator/index-default
Grid/tick complex API references:
- `majorGridLines` (width, color, dashArray)
- `majorTickLines` (width, color, dashArray)
- `tickPosition` and axis positioning props
Best Practices
1. Subtle Grid Lines: Use light colors (#E0E0E0, #F5F5F5) for grid lines to avoid visual clutter 2. Contrast: Ensure sufficient contrast between grid/tick lines and background 3. Consistency: Match grid and tick line styles for cohesive appearance 4. Accessibility: Don't rely solely on grid lines for data interpretation 5. Performance: Avoid extremely thin lines (< 0.5px) on low-DPI screens 6. Theme Matching: Coordinate colors with your application theme 7. Minimal When Possible: Hide grid/tick lines if not needed for cleaner appearance
Common Use Cases
Financial Charts
- Subtle dashed grid lines for reference
- Bold tick lines for precise time markers
Analytics Dashboards
- Solid light grid lines
- Standard tick lines
Minimalist Design
- No grid lines
- Subtle or no tick lines
High Contrast
- Bold grid lines
- Prominent tick lines in accent colors