User Interaction
When a user pauses on a series point, it changes its style to the one specified by the following objects.
series.point.hoverStyle
The hover style for all points of an individual series.commonSeriesSettings.point.hoverStyle
The hover style for all series points in the Chart. Individual series settings override common settings.
- <dx-chart ... >
- <dxi-series ... >
- <dxo-point>
- <dxo-hover-style>
- <!-- high priority -->
- </dxo-hover-style>
- </dxo-point>
- </dxi-series>
- <dxo-common-series-settings ... >
- <dxo-point>
- <dxo-hover-style>
- <!-- low priority -->
- </dxo-hover-style>
- </dxo-point>
- </dxo-common-series-settings>
- </dx-chart>
- import { DxChartModule } from "devextreme-angular";
- // ...
- export class AppComponent {
- // ...
- }
- @NgModule({
- imports: [
- // ...
- DxChartModule
- ],
- // ...
- })
To choose which series elements should be highlighted when a user pauses on a series point, specify the hoverMode property. Just like hoverStyle above, this property can be specified for all points belonging to an individual series or for all series points in the Chart.
- <dx-chart ... >
- <dxo-common-series-settings ... >
- <dxo-point
- hoverMode="allArgumentPoints"> <!-- or 'onlyPoint' | 'allSeriesPoints' | 'none' -->
- </dxo-point>
- </dxo-common-series-settings>
- </dx-chart>
- import { DxChartModule } from "devextreme-angular";
- // ...
- export class AppComponent {
- // ...
- }
- @NgModule({
- imports: [
- // ...
- DxChartModule
- ],
- // ...
- })
See Also
API
You can switch a point into the hover state by calling its hover() method, and its clearHover() method to switch it back to the normal state. The same API is available for series.
- import { DxChartModule } from "devextreme-angular";
- // ...
- export class AppComponent {
- togglePointHoverState (point) {
- !point.isHovered() ? point.hover() : point.clearHover();
- }
- }
- @NgModule({
- imports: [
- // ...
- DxChartModule
- ],
- // ...
- })
See Also
Events
When a user pauses on a series point, the Chart fires the pointHoverChanged event that you can handle with a function. If the handling function is not going to be changed during the lifetime of the UI component, assign it to the onPointHoverChanged property when you configure the UI component. To check whether the pointer entered or left a series, call the isHovered() method of the series.
- <dx-chart
- (onPointHoverChanged)="onPointHoverChanged($event)">
- </dx-chart>
- import { DxChartModule } from "devextreme-angular";
- // ...
- export class AppComponent {
- onPointHoverChanged (e) {
- const point = e.target;
- if (point.isHovered()) {
- // Commands to execute when the point is hovered over
- } else {
- // Commands to execute when the point is hovered out
- }
- };
- }
- @NgModule({
- imports: [
- // ...
- DxChartModule
- ],
- // ...
- })
See Also
If you have technical questions, please create a support ticket in the DevExpress Support Center.