-
Data Grid
- Overview
-
Data Binding
-
Paging and Scrolling
-
Editing
-
Grouping
-
Filtering and Sorting
- Focused Row
-
Row Drag & Drop
-
Selection
-
Columns
- State Persistence
-
Appearance
-
Templates
-
Data Summaries
-
Master-Detail
-
Export to PDF
-
Export to Excel
-
Adaptability
- Keyboard Navigation
-
Pivot Grid
- Overview
-
Data Binding
-
Field Chooser
-
Features
-
Export to Excel
-
Tree List
- Overview
-
Data Binding
- Sorting
- Paging
-
Editing
- Node Drag & Drop
- Focused Row
-
Selection
-
Filtering
-
Column Customization
- State Persistence
- Adaptability
- Keyboard Navigation
-
Scheduler
- Overview
-
Data Binding
-
Views
-
Features
- Virtual Scrolling
-
Grouping
-
Customization
- Adaptability
-
Html Editor
-
Chat
-
Diagram
- Overview
-
Data Binding
-
Featured Shapes
-
Custom Shapes
-
Document Capabilities
-
User Interaction
- UI Customization
- Adaptability
-
Charts
- Overview
-
Data Binding
-
Area Charts
-
Bar Charts
- Bullet Charts
-
Doughnut Charts
-
Financial Charts
-
Line Charts
-
Pie Charts
-
Point Charts
-
Polar and Radar Charts
-
Range Charts
-
Sparkline Charts
-
Tree Map
-
Funnel and Pyramid Charts
- Sankey Chart
-
Combinations
-
More Features
-
Export
-
Selection
-
Tooltips
-
Zooming
-
-
Gantt
- Overview
-
Data
-
UI Customization
- Strip Lines
- Export to PDF
- Sorting
-
Filtering
-
Gauges
- Overview
-
Data Binding
-
Bar Gauge
-
Circular Gauge
-
Linear Gauge
-
Navigation
- Overview
- Accordion
-
Menu
- Multi View
-
Drawer
-
Tab Panel
-
Tabs
-
Toolbar
- Pagination
-
Tree View
- Right-to-Left Support
-
Layout
-
Tile View
- Splitter
-
Gallery
- Scroll View
- Box
- Responsive Box
- Resizable
-
-
Editors
- Overview
- Autocomplete
-
Calendar
- Check Box
- Color Box
-
Date Box
-
Date Range Box
-
Drop Down Box
-
Number Box
-
Select Box
- Switch
-
Tag Box
- Text Area
- Text Box
- Validation
- Custom Text Editor Buttons
- Right-to-Left Support
- Editor Appearance Variants
-
Forms and Multi-Purpose
- Overview
- Button Group
- Field Set
-
Filter Builder
-
Form
- Radio Group
-
Range Selector
- Numeric Scale (Lightweight)
- Numeric Scale
- Date-Time Scale (Lightweight)
- Date-Time Scale
- Logarithmic Scale
- Discrete scale
- Custom Formatting
- Use Range Selection for Calculation
- Use Range Selection for Filtering
- Image on Background
- Chart on Background
- Customized Chart on Background
- Chart on Background with Series Template
- Range Slider
- Slider
-
Sortable
-
File Management
-
File Manager
- Overview
-
File System Types
-
Customization
-
File Uploader
-
-
Actions and Lists
- Overview
-
Action Sheet
-
Button
- Floating Action Button
- Drop Down Button
-
Context Menu
-
List
-
Lookup
-
Maps
- Overview
-
Map
-
Vector Map
-
Dialogs and Notifications
-
Localization
React Charts - Chart with Annotations
Annotations are containers for images, text blocks, and custom content that display additional information about the visualized data.
To create annotations, populate the Chart's annotations array. Each object in the array configures an individual annotation. To specify properties for all annotations, use the commonAnnotationSettings object. Individual settings take precedence over common settings.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
import React from 'react';
import {
Chart,
Title,
CommonSeriesSettings,
Series,
Legend,
ArgumentAxis,
ValueAxis,
CommonAnnotationSettings,
Font,
Image,
Annotation,
} from 'devextreme-react/chart';
import { dataSource, annotationSources } from './data.ts';
const customizeTooltip = (annotation) => ({
html: `<div class='tooltip'>${annotation.description}</div>`,
});
function App() {
return (
<Chart
id="chart"
dataSource={dataSource}
>
<Title text="Apple Stock Price" subtitle="AAPL" />
<CommonSeriesSettings argumentField="date" type="line" />
<Series valueField="close" name="AAPL" />
<Legend visible={false} />
<ArgumentAxis argumentType="datetime" />
<ValueAxis position="right" />
<CommonAnnotationSettings series="AAPL" type="image" customizeTooltip={customizeTooltip}>
<Font size={16} weight={600} />
<Image width={50.5} height={105.75} />
</CommonAnnotationSettings>
{
annotationSources.map((item) => <Annotation
key={item.description}
argument={item.date}
type={item.type}
text={item.text}
description={item.description}
paddingTopBottom={item.padding}
offsetY={item.offset}>
<Image url={item.image} />
</Annotation>)
}
</Chart>
);
}
export default App;
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
You can set each annotation's type property to "text", "image", or "custom". Depending on the type, specify the text or image property. You can also add a description that will be displayed in a tooltip.
Annotations can be unattached or anchored to a chart element. In this demo, all annotations are anchored to series points via the argument and series properties. Refer to the annotations description for more information on how to position annotations.