Implementing Range Selectors
NuGet: Syncfusion.Blazor.Charts + Syncfusion.Blazor.Themes (or Syncfusion.Blazor.RangeNavigator for individual package)
Namespace: Syncfusion.Blazor.Charts
A comprehensive skill for implementing Syncfusion Blazor Range Selector (RangeNavigator) components for data range selection and chart navigation. The Range Selector enables users to select a specific range from a large data collection using draggable thumbs, providing an intuitive way to filter and navigate through time-series or numeric data.
When to Use This Skill
Use this skill immediately when you need to:
- Enable range selection in charts with draggable thumbs
- Filter large time-series datasets by date range
- Navigate through financial data or stock prices
- Create chart zoom/pan controls with visual feedback
- Implement dashboard filtering based on data ranges
- Add period selector buttons (1M, 3M, 6M, YTD, 1Y, All) for quick navigation
- Display data trends with area, line, or stepline series
- Build interactive data exploration interfaces
- Filter data for drill-down analysis
- Create responsive range selection controls for Blazor Server, WebAssembly, or Web App
- Enable synchronized filtering across multiple charts
- Implement lightweight chart navigation for performance-critical scenarios
- Provide visual context for selected data ranges
Component Overview
The Syncfusion Blazor Range Selector (SfRangeNavigator) is a specialized control designed for data range selection and navigation. It combines:
- Draggable Thumbs: Left and right handles for selecting range boundaries
- Visual Series: Line, Area, or StepLine visualization of data trends
- Period Selector: Quick preset buttons via
RangeNavigatorPeriodSelectorSettings, RangeNavigatorPeriods, and RangeNavigatorPeriod
- Value Types: Support for DateTime, Numeric, and Logarithmic data
- Interactive Selection: Click labels or drag thumbs to update range
- Data Binding: Local and remote data source integration
- Customization: Extensive styling, theming, and formatting options using
RangeNavigatorBorder, RangeNavigatorMargin, RangeNavigatorStyleSettings, RangeNavigatorThumbSettings, and tooltip settings
Key Capabilities:
- Range Selection Methods: Drag thumbs, tap labels, or set programmatically
- Series Types: Line (default), Area, StepLine
- Value Binding: One-way and two-way binding support
- Integration: Works with period selectors and other charts
- Export: PNG, JPEG, SVG, PDF export functionality
- Accessibility: WCAG compliant with keyboard navigation
Documentation and Navigation Guide
Getting Started
📄 Read: references/getting-started.md
Start here for installation, setup, and your first range selector. Covers:
- Installing Syncfusion.Blazor.RangeNavigator NuGet package
- Blazor Server, WebAssembly, and Web App setup
- Service registration and theme configuration
- Basic SfRangeNavigator implementation with sample data
- Project structure and script references
- Troubleshooting common setup issues
Core Configuration
Range Selection and Values
📄 Read: references/range-configuration.md
Configure range selection behavior and value binding:
- Value property for start and end values
- One-way and two-way binding patterns
- Value types (DateTime, Numeric, Logarithmic)
- Thumb dragging for range selection
- Label tapping for quick selection
- Programmatic range updates and validation
Series Types
📄 Read: references/series-types.md
Choose and customize series visualization:
- Line series for trend lines
- Area series for filled regions
- StepLine series for discrete data
- Series customization (colors, width, fill)
- Multiple series support
Data and Integration
Data Binding
📄 Read: references/data-binding.md
Configure data sources for the range selector:
- Local data sources (List, Array, ExpandoObject)
- Remote data binding with SfDataManager
- DateTime data handling and formatting
- Numeric and logarithmic scale data
- Data refresh and dynamic updates
Period Selector Integration
📄 Read: references/period-selector-integration.md
Add period selector buttons for quick navigation:
- Predefined period buttons (1M, 3M, 6M, YTD, 1Y, All)
- Custom period configuration
- Integration with range changes
- Event handling for period selection
- Styling and positioning
Customization and Styling
Axis Customization
📄 Read: references/axis-customization.md
Customize axis, grid, and labels:
- Grid line configuration (major and minor)
- Tick customization (size, color, position)
- Label formatting and rotation
- Interval types (Years, Months, Days, Hours, Minutes)
- Logarithmic axis support
- RTL (Right-to-Left) support
Visual Customization
📄 Read: references/visual-customization.md
Control appearance, themes, and layout:
- Chart dimensions (Width, Height, Margin)
- Theme selection (Material, Bootstrap, Fluent, Tailwind, Fabric, Highcontrast)
- Tooltip configuration and templates
- Lightweight rendering mode for performance
- Custom styling and color schemes
- Responsive design patterns
Advanced Features
Export, Events, and Accessibility
📄 Read: references/export-events-accessibility.md
Handle exports, events, and ensure accessibility:
- Export: PNG, JPEG, SVG, PDF export functionality
- Events: Changed, Loaded, TooltipRender event handling
- Accessibility: WCAG compliance, keyboard navigation, screen readers, high contrast themes
- ARIA attributes and testing checklist
Quick Start Example
Here's a minimal range selector for time-series data filtering with event handling:
@using Syncfusion.Blazor.Charts
@{
DateTime[] range = SelectedRange as DateTime[] ?? new DateTime[] { DateTime.Now, DateTime.Now };
}
<h3>Stock Price Range Selector</h3>
<p>Selected Range: @range[0].ToShortDateString() to @range[1].ToShortDateString()</p>
<SfRangeNavigator @bind-Value="@SelectedRange"
ValueType="RangeValueType.DateTime"
LabelFormat="MMM-yy"
IntervalType="RangeIntervalType.Months">
<RangeNavigatorEvents Changed="OnRangeChanged"></RangeNavigatorEvents>
<RangeNavigatorRangeTooltipSettings Enable="true"></RangeNavigatorRangeTooltipSettings>
<RangeNavigatorSeriesCollection>
<RangeNavigatorSeries DataSource="@StockData"
XName="Date"
YName="Close"
Type="RangeNavigatorType.Area"
Fill="#3F51B5">
</RangeNavigatorSeries>
</RangeNavigatorSeriesCollection>
</SfRangeNavigator>
@code {
public class StockInfo
{
public DateTime Date { get; set; }
public double Close { get; set; }
}
public object SelectedRange = new DateTime[]
{
new DateTime(2020, 01, 01),
new DateTime(2021, 01, 01)
};
public List<StockInfo> StockData = new List<StockInfo>
{
new StockInfo { Date = new DateTime(2018, 01, 01), Close = 35 },
new StockInfo { Date = new DateTime(2019, 01, 01), Close = 42 },
new StockInfo { Date = new DateTime(2020, 01, 01), Close = 48 },
new StockInfo { Date = new DateTime(2021, 01, 01), Close = 56 },
new StockInfo { Date = new DateTime(2022, 01, 01), Close = 62 }
};
private void OnRangeChanged(ChangedEventArgs args)
{
// Handle range change event
Console.WriteLine($"Range changed: {args.Start} to {args.End}");
}
}
What this creates:
- Area chart showing stock price trend with blue fill (#3F51B5)
- Draggable thumbs for range selection
- Initially selected range: Jan 2020 to Jan 2021
- Month labels with "MMM-yy" format
- Tooltip showing values on hover
- Event handler responding to range changes
- Two-way binding with @bind-Value directive
Common Use Cases
1. Stock Price Filtering with Period Selector
Filter stock data with quick period buttons:
@using Syncfusion.Blazor.Charts
<SfRangeNavigator @bind-Value="@SelectedRange"
ValueType="RangeValueType.DateTime"
IntervalType="RangeIntervalType.Months"
LabelFormat="MMM yy">
<RangeNavigatorRangeTooltipSettings Enable="true" DisplayMode="TooltipDisplayMode.Always">
</RangeNavigatorRangeTooltipSettings>
<RangeNavigatorPeriodSelectorSettings>
<RangeNavigatorPeriods>
<RangeNavigatorPeriod Text="1M" Interval="1" IntervalType="RangeIntervalType.Months"></RangeNavigatorPeriod>
<RangeNavigatorPeriod Text="3M" Interval="3" IntervalType="RangeIntervalType.Months"></RangeNavigatorPeriod>
<RangeNavigatorPeriod Text="6M" Interval="6" IntervalType="RangeIntervalType.Months"></RangeNavigatorPeriod>
<RangeNavigatorPeriod Text="YTD"></RangeNavigatorPeriod>
<RangeNavigatorPeriod Text="1Y" Interval="1" IntervalType="RangeIntervalType.Years"></RangeNavigatorPeriod>
<RangeNavigatorPeriod Text="All"></RangeNavigatorPeriod>
</RangeNavigatorPeriods>
</RangeNavigatorPeriodSelectorSettings>
<RangeNavigatorSeriesCollection>
<RangeNavigatorSeries DataSource="@StockData" XName="Date" YName="Close" Type="RangeNavigatorType.Area">
</RangeNavigatorSeries>
</RangeNavigatorSeriesCollection>
</SfRangeNavigator>
@{
DateTime[] range = SelectedRange as DateTime[] ?? new DateTime[] { DateTime.Now, DateTime.Now };
}
<p>Selected Range: @range[0].ToShortDateString() to @range[1].ToShortDateString()</p>
@code {
public object SelectedRange = new DateTime[]
{
new DateTime(2022, 01, 01),
new DateTime(2023, 01, 01)
};
public List<StockInfo> StockData = GetStockData();
private static List<StockInfo> GetStockData()
{
// Sample data generation
var data = new List<StockInfo>();
var startDate = new DateTime(2020, 01, 01);
var random = new Random();
for (int i = 0; i < 100; i++)
{
data.Add(new StockInfo
{
Date = startDate.AddDays(i * 10),
Close = 100 + random.Next(-20, 20)
});
}
return data;
}
public class StockInfo
{
public DateTime Date { get; set; }
public double Close { get; set; }
}
}
2. Dashboard with Range-Based Filtering
Synchronize chart data with range selector:
@using Syncfusion.Blazor.Charts
<div class="dashboard-container">
<h3>Sales Dashboard</h3>
<SfRangeNavigator Value="@SelectedRange"
ValueType="RangeValueType.DateTime"
Height="140px">
<RangeNavigatorEvents Changed="OnRangeChanged" />
<RangeNavigatorSeriesCollection>
<RangeNavigatorSeries DataSource="@SalesDetails"
XName="Date"
YName="Revenue"
Type="RangeNavigatorType.Area" />
</RangeNavigatorSeriesCollection>
</SfRangeNavigator>
<SfChart Height="300px">
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.DateTime"
Minimum="@SelectedRange[0]"
Maximum="@SelectedRange[1]" />
<ChartSeriesCollection>
<ChartSeries DataSource="@FilteredData"
XName="Date"
YName="Revenue"
Type="ChartSeriesType.Column" />
</ChartSeriesCollection>
</SfChart>
</div>
@code {
public DateTime[] SelectedRange =
{
new DateTime(2023, 01, 01),
new DateTime(2023, 06, 30)
};
public List<SalesData> SalesDetails = new();
public List<SalesData> FilteredData = new();
protected override void OnInitialized()
{
SalesDetails = GetSalesData();
ApplyFilter();
}
private void OnRangeChanged(ChangedEventArgs args)
{
if (args.Start is DateTime start && args.End is DateTime end)
{
SelectedRange = new[] { start, end };
ApplyFilter();
}
}
private void ApplyFilter()
{
FilteredData = SalesDetails
.Where(d => d.Date >= SelectedRange[0] && d.Date <= SelectedRange[1])
.ToList();
}
private List<SalesData> GetSalesData()
{
var data = new List<SalesData>();
var random = new Random();
var start = new DateTime(2023, 01, 01);
decimal revenue = 15000;
for (int i = 0; i < 180; i++)
{
revenue += random.Next(-1500, 2000);
data.Add(new SalesData
{
Date = start.AddDays(i),
Revenue = Math.Max(revenue, 5000)
});
}
return data;
}
public class SalesData
{
public DateTime Date { get; set; }
public decimal Revenue { get; set; }
}
}
3. Lightweight Mode for Performance
Optimize for large datasets:
@using Syncfusion.Blazor.Charts
<SfRangeNavigator Value="@SelectedRange"
ValueType="RangeValueType.DateTime"
EnableGrouping="true"
GroupBy="RangeIntervalType.Months"
AllowSnapping="true">
<RangeNavigatorRangeTooltipSettings Enable="true"></RangeNavigatorRangeTooltipSettings>
<RangeNavigatorSeriesCollection>
<RangeNavigatorSeries DataSource="@LargeDataset"
XName="Timestamp"
YName="Value"
Type="RangeNavigatorType.Line">
</RangeNavigatorSeries>
</RangeNavigatorSeriesCollection>
</SfRangeNavigator>
@code {
public DateTime[] SelectedRange;
public List<DataPoint> LargeDataset = GenerateLargeDataset(10000);
public class DataPoint
{
public DateTime Timestamp { get; set; }
public double Value { get; set; }
}
private static List<DataPoint> GenerateLargeDataset(int count)
{
// Generate large dataset efficiently
return Enumerable.Range(0, count)
.Select(i => new DataPoint
{
Timestamp = DateTime.Now.AddHours(-count + i),
Value = Math.Sin(i * 0.1) * 100
})
.ToList();
}
}
Key Properties Reference
Essential Properties
| Property |
Type |
Description |
Default |
Value |
DateTime[] / double[] |
Selected range [start, end] |
null |
ValueType |
RangeValueType |
Data type (DateTime, Double, Logarithmic) |
Double |
DataSource |
object |
Data collection for series |
null |
IntervalType |
RangeIntervalType |
Axis interval (Auto, Years, Months, Days, etc.) |
Auto |
LabelFormat |
string |
Label display format |
null |
Width |
string |
Component width |
"100%" |
Height |
string |
Component height |
"80px" |
Theme |
Theme |
Visual theme (Material, Bootstrap5, Fluent, Tailwind, Fabric, HighContrast) |
Material |
Interval |
int |
Axis interval value |
1 |
LogBase |
double |
Base for logarithmic axis |
10 |
Orientation |
Orientation |
Horizontal or Vertical |
Horizontal |
Series Configuration
| Property |
Type |
Description |
Default |
Type |
RangeNavigatorType |
Series type (Line, Area, StepLine) |
Line |
XName |
string |
X-axis data field name |
null |
YName |
string |
Y-axis data field name |
null |
Fill |
string |
Series fill color |
null |
Width |
double |
Series line width |
1 |
Opacity |
double |
Series opacity (0-1) |
1 |
Name |
string |
Series name/label |
null |
Visual Properties
| Property |
Type |
Description |
Default |
EnableGrouping |
bool |
Enable data grouping |
false |
AllowSnapping |
bool |
Snap thumbs to data points |
false |
EnableRtl |
bool |
Right-to-Left support |
false |
TabIndex |
int |
Tab index for keyboard navigation |
0 |
Period Selector
| Property |
Type |
Description |
RangeNavigatorPeriodSelectorSettings |
Component |
Period selector configuration (Enabled, Height, Position) |
RangeNavigatorPeriods |
Collection |
Period button collection container |
RangeNavigatorPeriod |
Item |
Individual period selector button (Text, Interval, IntervalType, Selected) |
Tooltip Configuration
| Property |
Type |
Description |
Default |
RangeNavigatorRangeTooltipSettings.Enable |
bool |
Enable/disable tooltip |
true |
RangeNavigatorRangeTooltipSettings.DisplayMode |
TooltipDisplayMode |
Display mode (OnDemand, Always) |
OnDemand |
RangeNavigatorRangeTooltipSettings.Format |
string |
Tooltip content format template |
null |
Axis Customization
| Property |
Type |
Description |
RangeNavigatorMargin |
Component |
Margin (Left, Right, Top, Bottom) |
RangeNavigatorBorder |
Component |
Border (Color, Width, DashArray) |
RangeNavigatorMajorGridLines |
Component |
Gridlines (Width, Color, DashArray) |
RangeNavigatorMajorTickLines |
Component |
Tick lines (Width, Color, Height) |
RangeNavigatorLabelStyle |
Component |
Label styling (Color, FontFamily, Size, FontWeight) |
Thumb Configuration
| Property |
Type |
Description |
Default |
RangeNavigatorThumbSettings.Type |
ThumbType |
Thumb shape (Circle, Rectangle) |
Circle |
RangeNavigatorThumbSettings.Fill |
string |
Thumb fill color |
"#f3f3f3" |
RangeNavigatorThumbSettings.Size |
double |
Thumb size in pixels |
15 |
Events Reference
Key events for handling Range Navigator interactions:
| Event |
Event Args |
Description |
Changed |
ChangedEventArgs |
Fires when range selection changes (start, end, value) |
Loaded |
RangeLoadedEventArgs |
Fires after component loads completely |
Resizing |
RangeResizeEventArgs |
Fires while dragging thumbs |
Resized |
RangeResizeEventArgs |
Fires after thumb drag completes |
Rendering |
RangeSelectorRenderEventArgs |
Fires before selector renders |
TooltipRender |
RangeTooltipRenderEventArgs |
Fires before tooltip renders |
LabelRender |
RangeLabelRenderEventArgs |
Fires when labels render |
Example Event Handler:
private void OnRangeChanged(ChangedEventArgs args)
{
var startValue = args.Start; // DateTime or double
var endValue = args.End; // DateTime or double
var selectedData = args.SelectedData; // Filtered data
StateHasChanged();
}
Methods Reference
Key methods for programmatic control:
| Method |
Return Type |
Description |
ExportAsync(ExportType, string) |
Task |
Export as PNG, JPEG, SVG, or PDF |
Print() |
Task |
Print the Range Navigator |
Refresh() |
Task |
Refresh/redraw component |
GetVisibleRangeModel() |
VisibleRangeModel |
Get current visible range |
Implementation Workflow
When implementing a range selector, follow this sequence:
- Start with Getting Started for installation and basic setup
- Configure range values from Range Configuration for selection behavior
- Choose series type using Series Types for visualization
- Set up data binding from Data Binding for your data structure — when using remote data prefer trusted/internal APIs or mocked data; see Data Binding - Security Considerations
- Add period selector (optional) with Period Selector Integration
- Customize axis with Axis Customization for proper labeling
- Apply visual styling from Visual Customization
- Add export and events using Export, Events, and Accessibility
- Review API Reference for complete API documentation with all classes, properties, and enums
For questions or issues, refer to the troubleshooting sections in each reference file or consult Export, Events, and Accessibility for event handling patterns and accessibility requirements.
1---2name: syncfusion-blazor-range-selectors3description: Implement Syncfusion Blazor RangeNavigator for interactive data range selection and chart navigation. Trigger when users mention range selector, range navigator, SfRangeNavigator, Syncfusion.Blazor.Charts.RangeNavigator, time-series filtering, date range picker for charts, data zooming, slider navigation, thumb-based range selection, period selector, or chart data range selection for large data.4---5
6# Implementing Range Selectors
7
8**NuGet:** `Syncfusion.Blazor.Charts` + `Syncfusion.Blazor.Themes` (or `Syncfusion.Blazor.RangeNavigator` for individual package)
9**Namespace:** `Syncfusion.Blazor.Charts`
10
11A comprehensive skill for implementing Syncfusion Blazor Range Selector (RangeNavigator) components for data range selection and chart navigation. The Range Selector enables users to select a specific range from a large data collection using draggable thumbs, providing an intuitive way to filter and navigate through time-series or numeric data.
12
13## When to Use This Skill
14
15Use this skill immediately when you need to:
16- Enable range selection in charts with draggable thumbs
17- Filter large time-series datasets by date range
18- Navigate through financial data or stock prices
19- Create chart zoom/pan controls with visual feedback
20- Implement dashboard filtering based on data ranges
21- Add period selector buttons (1M, 3M, 6M, YTD, 1Y, All) for quick navigation
22- Display data trends with area, line, or stepline series
23- Build interactive data exploration interfaces
24- Filter data for drill-down analysis
25- Create responsive range selection controls for Blazor Server, WebAssembly, or Web App
26- Enable synchronized filtering across multiple charts
27- Implement lightweight chart navigation for performance-critical scenarios
28- Provide visual context for selected data ranges
29
30## Component Overview
31
32The **Syncfusion Blazor Range Selector** (`SfRangeNavigator`) is a specialized control designed for data range selection and navigation. It combines:
33
34- **Draggable Thumbs**: Left and right handles for selecting range boundaries
35- **Visual Series**: Line, Area, or StepLine visualization of data trends
36- **Period Selector**: Quick preset buttons via `RangeNavigatorPeriodSelectorSettings`, `RangeNavigatorPeriods`, and `RangeNavigatorPeriod`
37- **Value Types**: Support for DateTime, Numeric, and Logarithmic data
38- **Interactive Selection**: Click labels or drag thumbs to update range
39- **Data Binding**: Local and remote data source integration
40- **Customization**: Extensive styling, theming, and formatting options using `RangeNavigatorBorder`, `RangeNavigatorMargin`, `RangeNavigatorStyleSettings`, `RangeNavigatorThumbSettings`, and tooltip settings
41
42**Key Capabilities:**
43- **Range Selection Methods**: Drag thumbs, tap labels, or set programmatically
44- **Series Types**: Line (default), Area, StepLine
45- **Value Binding**: One-way and two-way binding support
46- **Integration**: Works with period selectors and other charts
47- **Export**: PNG, JPEG, SVG, PDF export functionality
48- **Accessibility**: WCAG compliant with keyboard navigation
49
50## Documentation and Navigation Guide
51
52### Getting Started
53
54📄 **Read:** [references/getting-started.md](references/getting-started.md)
55
56Start here for installation, setup, and your first range selector. Covers:
57- Installing Syncfusion.Blazor.RangeNavigator NuGet package
58- Blazor Server, WebAssembly, and Web App setup
59- Service registration and theme configuration
60- Basic SfRangeNavigator implementation with sample data
61- Project structure and script references
62- Troubleshooting common setup issues
63
64### Core Configuration
65
66#### Range Selection and Values
67
68📄 **Read:** [references/range-configuration.md](references/range-configuration.md)
69
70Configure range selection behavior and value binding:
71- Value property for start and end values
72- One-way and two-way binding patterns
73- Value types (DateTime, Numeric, Logarithmic)
74- Thumb dragging for range selection
75- Label tapping for quick selection
76- Programmatic range updates and validation
77
78#### Series Types
79
80📄 **Read:** [references/series-types.md](references/series-types.md)
81
82Choose and customize series visualization:
83- Line series for trend lines
84- Area series for filled regions
85- StepLine series for discrete data
86- Series customization (colors, width, fill)
87- Multiple series support
88
89### Data and Integration
90
91#### Data Binding
92
93📄 **Read:** [references/data-binding.md](references/data-binding.md)
94
95Configure data sources for the range selector:
96- Local data sources (List, Array, ExpandoObject)
97- Remote data binding with SfDataManager
98- DateTime data handling and formatting
99- Numeric and logarithmic scale data
100- Data refresh and dynamic updates
101
102#### Period Selector Integration
103
104📄 **Read:** [references/period-selector-integration.md](references/period-selector-integration.md)
105
106Add period selector buttons for quick navigation:
107- Predefined period buttons (1M, 3M, 6M, YTD, 1Y, All)
108- Custom period configuration
109- Integration with range changes
110- Event handling for period selection
111- Styling and positioning
112
113### Customization and Styling
114
115#### Axis Customization
116
117📄 **Read:** [references/axis-customization.md](references/axis-customization.md)
118
119Customize axis, grid, and labels:
120- Grid line configuration (major and minor)
121- Tick customization (size, color, position)
122- Label formatting and rotation
123- Interval types (Years, Months, Days, Hours, Minutes)
124- Logarithmic axis support
125- RTL (Right-to-Left) support
126
127#### Visual Customization
128
129📄 **Read:** [references/visual-customization.md](references/visual-customization.md)
130
131Control appearance, themes, and layout:
132- Chart dimensions (Width, Height, Margin)
133- Theme selection (Material, Bootstrap, Fluent, Tailwind, Fabric, Highcontrast)
134- Tooltip configuration and templates
135- Lightweight rendering mode for performance
136- Custom styling and color schemes
137- Responsive design patterns
138
139### Advanced Features
140
141#### Export, Events, and Accessibility
142
143📄 **Read:** [references/export-events-accessibility.md](references/export-events-accessibility.md)
144
145Handle exports, events, and ensure accessibility:
146- **Export**: PNG, JPEG, SVG, PDF export functionality
147- **Events**: Changed, Loaded, TooltipRender event handling
148- **Accessibility**: WCAG compliance, keyboard navigation, screen readers, high contrast themes
149- ARIA attributes and testing checklist
150
151## Quick Start Example
152
153Here's a minimal range selector for time-series data filtering with event handling:
154
155```razor
156@using Syncfusion.Blazor.Charts
157
158@{
159 DateTime[] range = SelectedRange as DateTime[] ?? new DateTime[] { DateTime.Now, DateTime.Now };
160}
161<h3>Stock Price Range Selector</h3>
162<p>Selected Range: @range[0].ToShortDateString() to @range[1].ToShortDateString()</p>
163
164<SfRangeNavigator @bind-Value="@SelectedRange"
165 ValueType="RangeValueType.DateTime"
166 LabelFormat="MMM-yy"
167 IntervalType="RangeIntervalType.Months">
168 <RangeNavigatorEvents Changed="OnRangeChanged"></RangeNavigatorEvents>
169 <RangeNavigatorRangeTooltipSettings Enable="true"></RangeNavigatorRangeTooltipSettings>
170 <RangeNavigatorSeriesCollection>
171 <RangeNavigatorSeries DataSource="@StockData"
172 XName="Date"
173 YName="Close"
174 Type="RangeNavigatorType.Area"
175 Fill="#3F51B5">
176 </RangeNavigatorSeries>
177 </RangeNavigatorSeriesCollection>
178</SfRangeNavigator>
179
180@code {
181 public class StockInfo
182 {
183 public DateTime Date { get; set; }
184 public double Close { get; set; }
185 }
186
187 public object SelectedRange = new DateTime[]
188 {
189 new DateTime(2020, 01, 01),
190 new DateTime(2021, 01, 01)
191 };
192
193 public List<StockInfo> StockData = new List<StockInfo>
194 {
195 new StockInfo { Date = new DateTime(2018, 01, 01), Close = 35 },
196 new StockInfo { Date = new DateTime(2019, 01, 01), Close = 42 },
197 new StockInfo { Date = new DateTime(2020, 01, 01), Close = 48 },
198 new StockInfo { Date = new DateTime(2021, 01, 01), Close = 56 },
199 new StockInfo { Date = new DateTime(2022, 01, 01), Close = 62 }
200 };
201
202 private void OnRangeChanged(ChangedEventArgs args)
203 {
204 // Handle range change event
205 Console.WriteLine($"Range changed: {args.Start} to {args.End}");
206 }
207}
208```
209
210**What this creates:**
211- Area chart showing stock price trend with blue fill (#3F51B5)
212- Draggable thumbs for range selection
213- Initially selected range: Jan 2020 to Jan 2021
214- Month labels with "MMM-yy" format
215- Tooltip showing values on hover
216- Event handler responding to range changes
217- Two-way binding with @bind-Value directive
218
219## Common Use Cases
220
221### 1. Stock Price Filtering with Period Selector
222
223Filter stock data with quick period buttons:
224
225```razor
226@using Syncfusion.Blazor.Charts
227
228<SfRangeNavigator @bind-Value="@SelectedRange"
229 ValueType="RangeValueType.DateTime"
230 IntervalType="RangeIntervalType.Months"
231 LabelFormat="MMM yy">
232 <RangeNavigatorRangeTooltipSettings Enable="true" DisplayMode="TooltipDisplayMode.Always">
233 </RangeNavigatorRangeTooltipSettings>
234 <RangeNavigatorPeriodSelectorSettings>
235 <RangeNavigatorPeriods>
236 <RangeNavigatorPeriod Text="1M" Interval="1" IntervalType="RangeIntervalType.Months"></RangeNavigatorPeriod>
237 <RangeNavigatorPeriod Text="3M" Interval="3" IntervalType="RangeIntervalType.Months"></RangeNavigatorPeriod>
238 <RangeNavigatorPeriod Text="6M" Interval="6" IntervalType="RangeIntervalType.Months"></RangeNavigatorPeriod>
239 <RangeNavigatorPeriod Text="YTD"></RangeNavigatorPeriod>
240 <RangeNavigatorPeriod Text="1Y" Interval="1" IntervalType="RangeIntervalType.Years"></RangeNavigatorPeriod>
241 <RangeNavigatorPeriod Text="All"></RangeNavigatorPeriod>
242 </RangeNavigatorPeriods>
243 </RangeNavigatorPeriodSelectorSettings>
244 <RangeNavigatorSeriesCollection>
245 <RangeNavigatorSeries DataSource="@StockData" XName="Date" YName="Close" Type="RangeNavigatorType.Area">
246 </RangeNavigatorSeries>
247 </RangeNavigatorSeriesCollection>
248</SfRangeNavigator>
249
250@{
251 DateTime[] range = SelectedRange as DateTime[] ?? new DateTime[] { DateTime.Now, DateTime.Now };
252}
253<p>Selected Range: @range[0].ToShortDateString() to @range[1].ToShortDateString()</p>
254
255@code {
256 public object SelectedRange = new DateTime[]
257 {
258 new DateTime(2022, 01, 01),
259 new DateTime(2023, 01, 01)
260 };
261
262 public List<StockInfo> StockData = GetStockData();
263
264 private static List<StockInfo> GetStockData()
265 {
266 // Sample data generation
267 var data = new List<StockInfo>();
268 var startDate = new DateTime(2020, 01, 01);
269 var random = new Random();
270
271 for (int i = 0; i < 100; i++)
272 {
273 data.Add(new StockInfo
274 {
275 Date = startDate.AddDays(i * 10),
276 Close = 100 + random.Next(-20, 20)
277 });
278 }
279
280 return data;
281 }
282
283 public class StockInfo
284 {
285 public DateTime Date { get; set; }
286 public double Close { get; set; }
287 }
288}
289```
290
291### 2. Dashboard with Range-Based Filtering
292
293Synchronize chart data with range selector:
294
295```razor
296@using Syncfusion.Blazor.Charts
297
298<div class="dashboard-container">
299 <h3>Sales Dashboard</h3>
300 <SfRangeNavigator Value="@SelectedRange"
301 ValueType="RangeValueType.DateTime"
302 Height="140px">
303
304 <RangeNavigatorEvents Changed="OnRangeChanged" />
305
306 <RangeNavigatorSeriesCollection>
307 <RangeNavigatorSeries DataSource="@SalesDetails"
308 XName="Date"
309 YName="Revenue"
310 Type="RangeNavigatorType.Area" />
311 </RangeNavigatorSeriesCollection>
312
313 </SfRangeNavigator>
314 <SfChart Height="300px">
315 <ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.DateTime"
316 Minimum="@SelectedRange[0]"
317 Maximum="@SelectedRange[1]" />
318
319 <ChartSeriesCollection>
320 <ChartSeries DataSource="@FilteredData"
321 XName="Date"
322 YName="Revenue"
323 Type="ChartSeriesType.Column" />
324 </ChartSeriesCollection>
325 </SfChart>
326</div>
327
328@code {
329 public DateTime[] SelectedRange =
330 {
331 new DateTime(2023, 01, 01),
332 new DateTime(2023, 06, 30)
333 };
334
335 public List<SalesData> SalesDetails = new();
336 public List<SalesData> FilteredData = new();
337
338 protected override void OnInitialized()
339 {
340 SalesDetails = GetSalesData();
341 ApplyFilter();
342 }
343
344 private void OnRangeChanged(ChangedEventArgs args)
345 {
346 if (args.Start is DateTime start && args.End is DateTime end)
347 {
348 SelectedRange = new[] { start, end };
349 ApplyFilter();
350 }
351 }
352
353 private void ApplyFilter()
354 {
355 FilteredData = SalesDetails
356 .Where(d => d.Date >= SelectedRange[0] && d.Date <= SelectedRange[1])
357 .ToList();
358 }
359
360 private List<SalesData> GetSalesData()
361 {
362 var data = new List<SalesData>();
363 var random = new Random();
364 var start = new DateTime(2023, 01, 01);
365 decimal revenue = 15000;
366
367 for (int i = 0; i < 180; i++)
368 {
369 revenue += random.Next(-1500, 2000);
370
371 data.Add(new SalesData
372 {
373 Date = start.AddDays(i),
374 Revenue = Math.Max(revenue, 5000)
375 });
376 }
377
378 return data;
379 }
380
381 public class SalesData
382 {
383 public DateTime Date { get; set; }
384 public decimal Revenue { get; set; }
385 }
386}
387```
388
389### 3. Lightweight Mode for Performance
390
391Optimize for large datasets:
392
393```razor
394@using Syncfusion.Blazor.Charts
395
396<SfRangeNavigator Value="@SelectedRange"
397 ValueType="RangeValueType.DateTime"
398 EnableGrouping="true"
399 GroupBy="RangeIntervalType.Months"
400 AllowSnapping="true">
401 <RangeNavigatorRangeTooltipSettings Enable="true"></RangeNavigatorRangeTooltipSettings>
402 <RangeNavigatorSeriesCollection>
403 <RangeNavigatorSeries DataSource="@LargeDataset"
404 XName="Timestamp"
405 YName="Value"
406 Type="RangeNavigatorType.Line">
407 </RangeNavigatorSeries>
408 </RangeNavigatorSeriesCollection>
409</SfRangeNavigator>
410
411@code {
412 public DateTime[] SelectedRange;
413 public List<DataPoint> LargeDataset = GenerateLargeDataset(10000);
414
415 public class DataPoint
416 {
417 public DateTime Timestamp { get; set; }
418 public double Value { get; set; }
419 }
420
421 private static List<DataPoint> GenerateLargeDataset(int count)
422 {
423 // Generate large dataset efficiently
424 return Enumerable.Range(0, count)
425 .Select(i => new DataPoint
426 {
427 Timestamp = DateTime.Now.AddHours(-count + i),
428 Value = Math.Sin(i * 0.1) * 100
429 })
430 .ToList();
431 }
432}
433```
434
435## Key Properties Reference
436
437### Essential Properties
438
439| Property | Type | Description | Default |
440|----------|------|-------------|---------|
441| `Value` | DateTime[] / double[] | Selected range [start, end] | null |
442| `ValueType` | RangeValueType | Data type (DateTime, Double, Logarithmic) | Double |
443| `DataSource` | object | Data collection for series | null |
444| `IntervalType` | RangeIntervalType | Axis interval (Auto, Years, Months, Days, etc.) | Auto |
445| `LabelFormat` | string | Label display format | null |
446| `Width` | string | Component width | "100%" |
447| `Height` | string | Component height | "80px" |
448| `Theme` | Theme | Visual theme (Material, Bootstrap5, Fluent, Tailwind, Fabric, HighContrast) | Material |
449| `Interval` | int | Axis interval value | 1 |
450| `LogBase` | double | Base for logarithmic axis | 10 |
451| `Orientation` | Orientation | Horizontal or Vertical | Horizontal |
452
453### Series Configuration
454
455| Property | Type | Description | Default |
456|----------|------|-------------|---------|
457| `Type` | RangeNavigatorType | Series type (Line, Area, StepLine) | Line |
458| `XName` | string | X-axis data field name | null |
459| `YName` | string | Y-axis data field name | null |
460| `Fill` | string | Series fill color | null |
461| `Width` | double | Series line width | 1 |
462| `Opacity` | double | Series opacity (0-1) | 1 |
463| `Name` | string | Series name/label | null |
464
465### Visual Properties
466
467| Property | Type | Description | Default |
468|----------|------|-------------|---------|
469| `EnableGrouping` | bool | Enable data grouping | false |
470| `AllowSnapping` | bool | Snap thumbs to data points | false |
471| `EnableRtl` | bool | Right-to-Left support | false |
472| `TabIndex` | int | Tab index for keyboard navigation | 0 |
473
474### Period Selector
475
476| Property | Type | Description |
477|----------|------|-------------|
478| `RangeNavigatorPeriodSelectorSettings` | Component | Period selector configuration (Enabled, Height, Position) |
479| `RangeNavigatorPeriods` | Collection | Period button collection container |
480| `RangeNavigatorPeriod` | Item | Individual period selector button (Text, Interval, IntervalType, Selected) |
481
482### Tooltip Configuration
483
484| Property | Type | Description | Default |
485|----------|------|-------------|---------|
486| `RangeNavigatorRangeTooltipSettings.Enable` | bool | Enable/disable tooltip | true |
487| `RangeNavigatorRangeTooltipSettings.DisplayMode` | TooltipDisplayMode | Display mode (OnDemand, Always) | OnDemand |
488| `RangeNavigatorRangeTooltipSettings.Format` | string | Tooltip content format template | null |
489
490### Axis Customization
491
492| Property | Type | Description |
493|----------|------|-------------|
494| `RangeNavigatorMargin` | Component | Margin (Left, Right, Top, Bottom) |
495| `RangeNavigatorBorder` | Component | Border (Color, Width, DashArray) |
496| `RangeNavigatorMajorGridLines` | Component | Gridlines (Width, Color, DashArray) |
497| `RangeNavigatorMajorTickLines` | Component | Tick lines (Width, Color, Height) |
498| `RangeNavigatorLabelStyle` | Component | Label styling (Color, FontFamily, Size, FontWeight) |
499
500### Thumb Configuration
501
502| Property | Type | Description | Default |
503|----------|------|-------------|---------|
504| `RangeNavigatorThumbSettings.Type` | ThumbType | Thumb shape (Circle, Rectangle) | Circle |
505| `RangeNavigatorThumbSettings.Fill` | string | Thumb fill color | "#f3f3f3" |
506| `RangeNavigatorThumbSettings.Size` | double | Thumb size in pixels | 15 |
507
508## Events Reference
509
510Key events for handling Range Navigator interactions:
511
512| Event | Event Args | Description |
513|-------|-----------|-------------|
514| `Changed` | `ChangedEventArgs` | Fires when range selection changes (start, end, value) |
515| `Loaded` | `RangeLoadedEventArgs` | Fires after component loads completely |
516| `Resizing` | `RangeResizeEventArgs` | Fires while dragging thumbs |
517| `Resized` | `RangeResizeEventArgs` | Fires after thumb drag completes |
518| `Rendering` | `RangeSelectorRenderEventArgs` | Fires before selector renders |
519| `TooltipRender` | `RangeTooltipRenderEventArgs` | Fires before tooltip renders |
520| `LabelRender` | `RangeLabelRenderEventArgs` | Fires when labels render |
521
522**Example Event Handler:**
523```csharp
524private void OnRangeChanged(ChangedEventArgs args)
525{
526 var startValue = args.Start; // DateTime or double
527 var endValue = args.End; // DateTime or double
528 var selectedData = args.SelectedData; // Filtered data
529 StateHasChanged();
530}
531```
532
533## Methods Reference
534
535Key methods for programmatic control:
536
537| Method | Return Type | Description |
538|--------|------------|-------------|
539| `ExportAsync(ExportType, string)` | `Task` | Export as PNG, JPEG, SVG, or PDF |
540| `Print()` | `Task` | Print the Range Navigator |
541| `Refresh()` | `Task` | Refresh/redraw component |
542| `GetVisibleRangeModel()` | `VisibleRangeModel` | Get current visible range |
543
544## Implementation Workflow
545
546When implementing a range selector, follow this sequence:
547
5481. **Start with [Getting Started](references/getting-started.md)** for installation and basic setup
5492. **Configure range values** from [Range Configuration](references/range-configuration.md) for selection behavior
5503. **Choose series type** using [Series Types](references/series-types.md) for visualization
5514. **Set up data binding** from [Data Binding](references/data-binding.md) for your data structure — when using remote data prefer trusted/internal APIs or mocked data; see [Data Binding - Security Considerations](references/data-binding.md)
5525. **Add period selector** (optional) with [Period Selector Integration](references/period-selector-integration.md)
5536. **Customize axis** with [Axis Customization](references/axis-customization.md) for proper labeling
5547. **Apply visual styling** from [Visual Customization](references/visual-customization.md)
5558. **Add export and events** using [Export, Events, and Accessibility](references/export-events-accessibility.md)
5569. **Review [API Reference](references/api-reference.md)** for complete API documentation with all classes, properties, and enums
557
558For questions or issues, refer to the troubleshooting sections in each reference file or consult [Export, Events, and Accessibility](references/export-events-accessibility.md) for event handling patterns and accessibility requirements.