User Interaction
A series point's style changes when a user hovers the mouse pointer over it. The series.hoverStyle object specifies this style.
- <template>
- <DxPieChart ... >
- <DxSeries>
- <DxHoverStyle>
- <!-- ... -->
- </DxHoverStyle>
- </DxSeries>
- </DxPieChart>
- </template>
- <script>
- import DxPieChart, {
- DxSeries,
- DxHoverStyle
- } from 'devextreme-vue/pie-chart';
- export default {
- components: {
- DxPieChart,
- DxSeries,
- DxHoverStyle
- }
- }
- </script>
You can disable this feature by assigning "none" to the series.hoverMode property.
- <template>
- <DxPieChart ... >
- <DxSeries hover-mode="none" />
- </DxPieChart>
- </template>
- <script>
- import DxPieChart, {
- DxSeries
- } from 'devextreme-vue/pie-chart';
- export default {
- components: {
- DxPieChart,
- DxSeries
- }
- }
- </script>
API
You can switch a series point into the hover state and back again by calling its hover() and clearHover() method, respectively.
- <template>
- <DxPieChart ... >
- </DxPieChart>
- </template>
- <script>
- import DxPieChart from 'devextreme-vue/pie-chart';
- export default {
- components: {
- DxPieChart
- },
- methods: {
- togglePointHoverState(point) {
- !point.isHovered() ? point.hover() : point.clearHover();
- }
- }
- }
- </script>
See Also
Events
When a user hovers the mouse pointer on a series point, the PieChart fires the pointHoverChanged event that you can handle with a function. Assign this function to the onPointHoverChanged property when you configure the UI component if it is going to remain unchanged during the UI component's lifetime. Call the point's isHovered() method to check whether the pointer entered or left a series point.
- <template>
- <DxPieChart ...
- @point-hover-changed="onPointHoverChanged">
- </DxPieChart>
- </template>
- <script>
- import DxPieChart from 'devextreme-vue/pie-chart';
- export default {
- components: {
- DxPieChart
- },
- methods: {
- onPointHoverChanged({ target: point }) {
- if (point.isHovered()) {
- // Command to execute when the mouse pointer enters the point
- } else {
- // Command to execute when the mouse pointer leaves the point
- }
- }
- }
- }
- </script>
See Also
If you have technical questions, please create a support ticket in the DevExpress Support Center.