React Migration in Chart Component
This section explains how to migrate the Chart component from EJ2 React to React. It highlights the API differences where property names or usage patterns changed and shows how to enable those APIs in JSX.
Chart Properties
| EJ2 React | React | Description |
|---|---|---|
Props: | Props: | In EJ2 React, focus styling was controlled by three separate props. In React, these settings are consolidated into the |
Props: | Props: | The |
Chart Area
| EJ2 React | React | Description |
|---|---|---|
API: | API: | The chart area configuration moves from an inline object |
Title
| EJ2 React | React | Description |
|---|---|---|
Props: | Props: | Determines the alignment of the title within its container. • Available options: • Left: Aligns the title to the left. • Center: Aligns the title to the center. • Right: Aligns the title to the right. |
Props: | Props: | The background color of the chart title area. Accepts any valid CSS color value. |
Props: | Props: | Defines the border styling for the chart title area. |
Props: | Props: | Sets the color of the title. Accepts any valid CSS color string, including hexadecimal and RGBA formats. |
Props: | Props: | Specifies the font family used for the title (e.g., 'Arial', 'Verdana', 'sans-serif'). |
Props: | Props: | Sets the font size of the text in pixels. |
Props: | Props: | Specifies the font style of the title (e.g., 'Normal', 'Italic'). |
Props: | Props: | Specifies the font weight (thickness) of the title (e.g., 'Normal', 'Bold', '400'). |
Props: | Props: | Sets the opacity level of the title. A value of 1 means fully opaque, while 0 means fully transparent. |
Props: | Props: | Determines the position of the chart title relative to the chart area. Available options: • Top: Displays the title above the chart. • Left: Displays the title to the left of the chart. • Bottom: Displays the title below the chart. • Right: Displays the title to the right of the chart. • Custom: Allows manual positioning using x and y coordinates. |
Props: | Props: | Specifies the main title text of the chart. This text provides context or a label for the chart's data. |
Props: | Props: | Controls how the title behaves when it overflows its container. Available options: • Wrap: Wraps the text onto a new line. • Trim: Trims the overflowed text. • None: Displays the text even when it overflows. |
Props: | Props: | X-coordinate for positioning the chart title. Only applicable when position is set to Custom. |
Props: | Props: | Y-coordinate for positioning the chart title.Only applicable when position is set to Custom. |
Rows
| EJ2 React | React | Description |
|---|---|---|
API: | API: | Rows configuration moves from an array of objects on the |
Columns
| EJ2 React | React | Description |
|---|---|---|
API: | API: | Columns configuration moves from an array of objects on the |
Series
| EJ2 React | React | Description |
|---|---|---|
Props: | Props: | Maps a data source field to assign individual colors to each point in the series. |
Props: | Props: | Specifies the name of the data field that contains the values used to determine the size (radius) of each bubble in a bubble chart. |
Props: | Props: | Maps a specific field from the data source to use as tooltip content. The mapped field's value is stored in the point's tooltip property and it can be accessed through tooltip format. |
Props: | Props: | Specifies the name of the field in the data source that maps values to the x-axis of the chart. This property is essential for identifying which data dimension should be plotted horizontally, such as categories, timestamps, or numerical values. |
Props: | Props: | Specifies the name of the field in the data source that provides the values to be plotted along the y-axis. This property is used to map vertical data points in the chart, such as numerical values or metrics. |
Props: | Props: | Indicates whether to display the normal distribution curve for the Histogram series. Default: |
Props: | Props: | Specifies the bin interval (bin width) used to group numeric values in the Histogram. Default: |
Props: | Props: | Indicates whether the mean value should be calculated and displayed for the Box-and-Whisker series. Default: |
Props: | Props: | Defines the statistical method used to calculate quartiles and whisker ranges. Options: |
Props: | Props: | Controls whether values outside the whisker range are shown as outliers (rendered as markers). Default: |
Props: | Props: | In EJ2 React, Waterfall colors were limited to In React, these are moved into |
Props: | Props: | Specifies the indexes of data points that should be treated as intermediate (sub-total) sum points.
Default: |
Props: | Props: | Specifies the indexes of data points that should be treated as total (final sum) points.
Default: |
Props: | Props: | Configures the connector line that visually links the columns in a Waterfall chart.
Default: |
Marker
| EJ2 React | React | Description |
|---|---|---|
Props: | Component Props: | Determines whether the marker should be filled with the series color. When set to true, the marker is filled using the corresponding series color, enhancing visual distinction. When set to false, the marker will be rendered with no fill or default styling. |
Props: | Component Props: | When set to true, markers are visually emphasized on hover or selection, enhancing visibility and user feedback during data exploration. |
Data Label
| EJ2 React | React | Description |
|---|---|---|
Props: | Component Props: | Specifies the horizontal (x) and vertical (y) corner radius for the background of the data label. This controls how rounded the corners of the label background appear. |
Props: | Component Props: | Specifies how overlapping data labels are handled. Available options: • None - Labels are displayed without overlap. • Hide - Overlapping labels are hidden. • Trim - Truncates labels with ellipsis to avoid overlap. • Wrap - Wraps labels onto multiple lines when space is limited. • Rotate90 - Labels are rotated 90° to reduce overlap. |
Props: | Component Props: | Maps a specific field from the data source to use as the data label content. The mapped field's value is displayed as the label for each data point. |
Props: | Component Props: | Specifies the rotation angle (in degrees) for the data label. A positive value rotates the label clockwise, while a negative value rotates it counterclockwise. This property is only effective when enableRotation is set to true. |
Props: | Component Props: | Sets the alignment of the data label relative to the data point. Available options: • Left - Left-aligned. • Center - Center-aligned. • Right - Right-aligned. |
Axis
| EJ2 React | React | Description |
|---|---|---|
Props: | Component Props: | When set to true, data points are rendered based on their index position rather than their actual x-axis values. |
Props: | Component Props: | When set to true, the axis is rendered in reverse order, displaying values from maximum to minimum. |
Props: | Component Props: | Specifies the maximum number of labels per 100 pixels of axis length. |
Major Grid Lines
| EJ2 React | React | Description |
|---|---|---|
API: | API: | The major grid lines configuration moves from the inline |
Major Tick Lines
| EJ2 React | React | Description |
|---|---|---|
API: | API: | The major tick lines configuration moves from the inline |
Minor Grid Lines
| EJ2 React | React | Description |
|---|---|---|
API: | API: | The minor grid lines configuration moves from the inline |
Minor Tick Lines
| EJ2 React | React | Description |
|---|---|---|
API: | API: | The minor tick lines configuration moves from the inline |
Axis Label
| EJ2 React | React | Description |
|---|---|---|
Props: | Component Props: | Sets the alignment of the axis label relative to the tick mark. Available options: • Left - Aligns label to the left. • Center - Centers the label. • Right - Aligns label to the right. |
Props: | Component Props: | Sets the font size of the text in pixels. |
Props: | Component Props: | Used to format the axis label. This property accepts global string formats such as C, n1, P, etc. It also accepts placeholders like {value}°C, where {value} represents the axis label (e.g., 20°C). |
Props: | Component Props: | Defines how overlapping labels on the axis are handled. Available options: • None - No special action for overlapping. • Hide - Hides overlapping labels. • Trim - Trims labels to fit. • Rotation - Rotates labels. • MultipleRows - Places each label on its own row. |
Props: | Component Props: | Adjusts the vertical spacing between the axis labels and the axis line. A higher value increases the distance, ensuring better readability. |
Props: | Component Props: | Determines the position of the labels relative to the axis line. Available options: • Inside - Positions labels inside the axis area. • Outside - Positions labels outside the axis area. • Auto - Automatically determines the best position based on available space. |
Props: | Component Props: | Specifies the angle in degrees to rotate the axis label text. A positive value rotates the label clockwise, and a negative value rotates it counterclockwise. |
Axis Title
| EJ2 React | React | Description |
|---|---|---|
Props: | Component Props: | Sets the alignment of the axis title relative to the axis. Available options: • Left - Aligns title to the left. • Center - Centers the title. • Right - Aligns title to the right. |
Props: | Component Props: | Controls how the axis title behaves when it overflows its container. Available options: • Wrap: Wraps the text onto a new line. • Trim: Trims the overflowed text. • None: Displays the text even when it overflows. |
Props: | Component Props: | Specifies the padding between the axis title and the axis labels. |
Props: | Component Props: | Defines an angle for rotating the axis title. By default, the angle is calculated based on the position and orientation of the axis. |
Props: | Component Props: | Specifies the text content of the axis title. |
Strip Lines
| EJ2 React | React | Description |
|---|---|---|
API: | Component Props: | Specifies the range and dimensions of the strip line on the axis. This object defines where the strip line begins, its width or height, and how its size is calculated, forming the core of the highlighted region. |
Props: | Component Props: | Configures repeating strip lines that recur at a regular interval. This is useful for highlighting patterns, such as weekends on a date-time axis or alternating bands for every 'n' units on a numeric axis. |
Props: | Component Props: | Configures a segmented strip line that is rendered only within the specified range of another axis. This enables the creation of conditional highlights that are visible only when a data point falls within a specific range on two different axes. |
Props: | Component Props: | Customizes the visual appearance of the strip line, including its background and border. You can set properties like color, opacity, background images, and dash patterns to make the strip line stand out or blend in with the chart's design. |
Props: | Component Props: | Configures the text displayed within the strip line. This allows you to add descriptive labels or annotations directly on the highlighted range, with options to control text content, styling, rotation, and alignment. |
Axes
| EJ2 React | React | Description |
|---|---|---|
API: | API: | Axes configuration moves from an array of objects on the |
Legend
| EJ2 React | React | Description |
|---|---|---|
API: | API: | The legend configuration moves from an inline |
Props: | Props: | Specifies the horizontal alignment of the legend items. Changed property names include |
Props: | Props: | When enabled, reverses the order of elements within each legend item. Places text before the shape/symbol instead of the default shape-then-text order. |
Props: | Props: | Sets the alignment of the legend title relative to the legend area. Available options: • Left - Aligns title to the left. • Center - Centers the title. • Right - Aligns title to the right. |
Props: | Props: | Controls how the legend title behaves when it overflows its container. Available options: • Wrap: Wraps the text onto a new line. • Trim: Trims the overflowed text. • None: Displays the text even when it overflows. |
Props: | Props: | Sets the font size of the legend title in pixels. |
Tooltip
| EJ2 React | React | Description |
|---|---|---|
API: | API: | The tooltip configuration moves from an inline |
Props: | Props: | Customizes the header text displayed at the top of the tooltip. By default, displays the series name. |
Props: | Props: | When set to true, displays colored markers within the tooltip to indicate the corresponding series for each data point. |
Props: | Props: | Sets the font size of the tooltip text in pixels. |
Zoom Settings
| EJ2 React | React | Description |
|---|---|---|
API: | API: | The zoom settings have moved from the inline |
Props: | Props: | Enables chart panning without requiring toolbar interaction. When enabled, users can pan a zoomed chart directly by clicking and dragging. |
Props: | Props: | Provides configuration settings for the zoom toolbar displayed on the chart. Lets you control its visibility, toolbar items, and position within the chart area. Toolbar items like 'ZoomIn', 'ZoomOut', 'Pan', 'Reset' match the available options. |
Props: | Props: | Enables chart zooming using the mouse wheel for desktop users. Scroll up to zoom in and scroll down to zoom out. |
Props: | Props: | Enables zooming with pinch gestures on touch-enabled devices. Users can pinch in to zoom in and pinch out to zoom out. |
Props: | Props: | Enables zooming by selecting a rectangular region within the chart area. Users can click and drag to define the region they want to zoom into. |
Stack Labels
| EJ2 React | React | Description |
|---|---|---|
Props: | Component Props: | Sets the alignment of the stack label text within its container. Available options: • Left - Aligns text to the left. • Center - Centers the text. • Right - Aligns text to the right. |
Props: | Component Props: | Defines the border radius configuration for the stack label background. Controls the curvature of corners for both horizontal and vertical axes. |
Props: | Component Props: | Sets the font size of the stack label text. |
Props: | Component Props: | Specifies the rotation angle of the stack labels in degrees. |
Trendline
| EJ2 React | React | Description |
|---|---|---|
API: | API: | Trendline configuration moves from |
Props: | Props: | Specifies the type of trendline to be rendered. Available options:
|
Props: | Props: | Display name of the trendline shown in the chart legend. |
Props: | Props: | Sets the stroke color of the trendline. Accepts any valid CSS color string. |
Props: | Props: moved to child | Marker configuration moves from an inline |
Property Name Changes: | Property Name Changes: | The |
Technical Indicators
| EJ2 React | React | Description |
|---|---|---|
API: | API: | Technical indicator configuration moves from |
Props: | Props: | Specifies the type of technical indicator to be rendered. Supported indicator types include:
|
Props: | Props: | Specifies the name of the source series used for calculating the indicator values. |
Props: | Props: | Specifies the financial data field used to compare the current value with previous values when calculating technical indicators. This property is applicable to indicators that require price-based comparisons such as RSI, MACD, ATR, and Stochastic. |
Last Value Label
| EJ2 React | React | Description |
|---|---|---|
API: | API: | Last value label configuration moves from an inline |
Props: | Props: | Enables or disables the display of the last value label. |
Props: | Props: | Line styling for connector/grid lines behind the labels. In EJ2 React, these were separate properties (lineColor, lineWidth, dashArray). In React, they are consolidated into the |
Scrollbar
| EJ2 React | React | Description |
|---|---|---|
API: | API: | Scrollbar configuration moves from inline |
API: | API: | Enables scrollbar interaction with zoom functionality. This is configured globally on |
Props: | Props: | Enables or disables the scrollbar for the associated axis. |
Props: | Props: | Specifies the thickness of the scrollbar track. For horizontal scrollbars this represents height; for vertical scrollbars, this represents width. |
Props: | Props: | Defines the corner radius of the scrollbar thumb. |
Props: | Props: | Specifies the fill color of the scrollbar thumb. |
Props: | Props: | Specifies the position of the scrollbar relative to the axis. Available options:
|
Series Label
| EJ2 React | React | Description |
|---|---|---|
API: | API: | Configures options for displaying series names as inline labels in the chart. In EJ2 React, labels are configured inline via |
Props: | Props: | Enables or disables the rendering of series names as inline labels. |
Pareto Options
| EJ2 React | React | Description |
|---|---|---|
API: | API: | Moves Pareto-specific configuration from an inline |
Props: | Props: moved to child | Marker settings were moved from an inline |
Multi Level Labels
| EJ2 React | React | Description |
|---|---|---|
API: | API: | Moves multi-level axis label configuration from an inline |
Props: | Props: | Configures multi-level categories for multi-level labels. Each category defines a range within the axis with a |
Props: | Props: | Defines the position of the multi-level labels. Available options: |
Props: | Props: | Defines the text overflow behavior for multi-level labels. Options: |
Polar Radar Series
| EJ2 React | React | Description |
|---|---|---|
API: | API: | Polar/Radar draw types in EJ2 (separate |
Props: | Props: | Maps EJ2
|
Events
This section outlines how event handlers in the Chart component are mapped when migrating from EJ2 React to React. It highlights the differences in naming conventions and usage.
| EJ2 React | React | Description |
|---|---|---|
Event: | Event: | Triggered after an axis label is clicked. |
Event: | Event: | Triggered when the chart is clicked. |
Event: | Event: | Triggered after a legend item is clicked. |
Event: | Event: | Triggered when the mouse leaves the chart. |
Event: | Event: | Triggered when the mouse moves over the chart. |
Event: | Event: | Triggered when a data point in the chart is clicked. |
Event: | Event: | Triggered after the chart is resized. |
Event: | Event: | Triggered when a zooming operation ends. |
Event: | Event: | Triggered after a zoom selection operation is completed. |
Crosshair
| EJ2 React | React | Description |
|---|---|---|
Prop: | Component: | Enables or disables the crosshair line. When set to true, the crosshair line is visible. |
Prop: | Prop: | Specifies the visual style of the crosshair line. You can customize the line's color, width, and dash pattern using the |
Crosshair Tooltip
| EJ2 React | React | Description |
|---|---|---|
Prop: | Component: | When set to true, a tooltip will be displayed at the axis intersection point when the crosshair is active. |
Annotation
| EJ2 React | React | Description |
|---|---|---|
Prop: | Prop: | Content of the annotation. Accepts HTML string, plain text, or DOM element ID. |
Prop: | Prop: | Defines whether position values are axis-based ('Point') or pixel-based ('Pixel'). |
Prop: | Prop: | Horizontal alignment relative to the X-position. Available options: Right aligns the annotation to the right of its anchor or target, Center centers the annotation horizontally on its anchor or target, and Left aligns the annotation to the left of its anchor or target. |
Prop: | Prop: | Vertical alignment relative to the Y-position. Available options: Top aligns the annotation above its anchor or target, Center vertically centers the annotation on its anchor or target, and Bottom aligns the annotation below its anchor or target. |
Error Bar
| EJ2 React | React | Description |
|---|---|---|
Prop: | Prop: | If set to true, the error bar for the data will be rendered. |
Prop: | Prop: | Defines the color for the error bar, which is mapped to the data source mapping name. |
CrossAxis
| EJ2 React | React | Description |
|---|---|---|
Prop: | Prop: | Defines the value at which the axis line intersects with another axis. This can be a numeric value, date, or category name, depending on the axis type. |
Prop: | Prop: | Specifies the name of the target axis that the current axis line should intersect. |
Prop: | Prop: | Indicates whether the axis line is allowed to overlap axis elements such as labels and titles. When set to true, the axis line may cross over these elements. |
Selection
| EJ2 React | React | Description |
|---|---|---|
Prop: | Prop: | Specifies how data points or series can be selected or highlighted. Available options: 'None' disables selection, 'Series' selects the entire series, 'Point' selects individual data points, 'Cluster' selects a group of related data points. |
Prop: | Prop: | Enables selection of multiple data points, series, or clusters. Note that the selectionMode must be set to 'Point', 'Series', or 'Cluster' for multi-selection to be enabled. |
Prop: | Prop: | Defines the indexes of points to be selected when the chart is initially rendered. Note that selectionMode or highlightMode must be set to 'Point', 'Series', or 'Cluster' for this feature to work. |
Prop: | Prop: | Specifies the visual pattern applied to selected data points or series. |
Highlight
| EJ2 React | React | Description |
|---|---|---|
Prop: | Prop: | Specifies how data points or series can be highlighted. Available options: 'None' disables highlighting, 'Series' highlights the entire series, 'Point' highlights individual data points, 'Cluster' highlights a group of related data points. |
Prop: | Prop: | Specifies the color used to highlight a data point when hovered. |
Prop: | Prop: | Defines the visual pattern applied to highlighted data points or series. |