- Animating a Chart control
- Modifying or deleting the animation through programming
Animation of Chart control
The animation of the Chart control allows you to propose a dynamic display in your applications.
For example, during the first display of a Column chart, each bar seems to fly out from the X-axis. The animation is also performed when a value is modified.
The animation of the Chart control is defined in the editor, in the "Details"
tab of the control description window.
Animating a Chart control
To animate a Chart control:
- Open the Chart control description window.
- In the "Details" tab:
- In "Animations of 2D charts", check "Enable animations".
- In "Animations", check "Enable animations".
- In "Interactivity", check "Interactive chart" if necessary, then "Enable animations".Remark: The "Interactive chart" option allows to create charts that react to the actions of the user. For example, in a Pie chart, the hovered section is automatically pulled out, the clicked section is positioned at the bottom of chart, the value selected in the legend is made invisible, ...
Only interactive charts are available.
- Validate the control description window.
- This option is available for the following types of charts:
- Area, Bubble, Line, Donut, Column, MinMax, Radar, Pie, Waterfall.
- Area, Bubble, Line, Donut, Column, Pie.
- Area, Line, Bar, Stacked Column, Pie, Donut, Semi-circular.
- The animation performed on the Chart controls depends on the type of chart displayed. This animation cannot be configured.
- By default, the animation of a Chart control lasts 30 milliseconds.
- If a Chart control is animated, the animation will also be performed when the chart is drawn further to a change of value (grDraw).
- grDraw is not a locking function. If he chart is drawn with an animation, the function will give control back as soon as the animation starts. Therefore, if several charts are drawn in the same window, the controls can be animated simultaneously.
- The Chart controls created from version 19 are animated by default.
Modifying or deleting the animation through programming
- Find out and modify the duration of the animation in a Chart control.
// Increase timeout
CHART_MyChart.AnimationDuration = 2000
- Cancel the animation of a Chart control. To do so, change the duration of the animation and give it a null value.
// Temporarily stops the animation
CHART_MyChart.AnimationDuration = 0
Training (WINDEV): WD Chart
Unit examples (WINDEV): The Chart functions
This page is also available for…