Skip to content

Commit 4963660

Browse files
author
Jelte Lagendijk
committed
Cleanup & fix animation duration (not using globals anymore)
1 parent 94b242a commit 4963660

File tree

11 files changed

+39
-3200
lines changed

11 files changed

+39
-3200
lines changed

src/ChartJS/lib/moment.js

Lines changed: 0 additions & 3195 deletions
This file was deleted.

src/ChartJS/widgets/BarChart/BarChart.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@
5757
<category>Appearance</category>
5858
<description>Switch animation on and off. Try to switch it off when you have rendering problems with multiple charts on a page</description>
5959
</property>
60+
<property key="animationDuration" type="integer" required="true" defaultValue="1000">
61+
<caption>Animation duration</caption>
62+
<category>Appearance</category>
63+
<description>Animation duration (milliseconds) for rendering (this is different from the Responsive animation duration)</description>
64+
</property>
6065
<!-- Data Source -->
6166
<property key="sourceentity" type="entity" required="true" allowNonPersistableEntities="true">
6267
<caption>Chart Entity</caption>

src/ChartJS/widgets/Core.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,6 @@ define([
8989
this._chartJS.defaults.global.tooltipEvents = ["mouseover", "mouseup", "mousedown", "mousemove", "touchstart", "touchmove", "mouseout"];
9090
this._chartJS.defaults.global.tooltipXOffset = 0;
9191

92-
if (!this.chartAnimation) {
93-
this._chartJS.defaults.global.animation.duration = 0;
94-
}
95-
9692
// Set object , dataset and datapoint.
9793
this._dataset = this.datasetentity.split("/")[0];
9894
this._datapoint = this.datapointentity && this.datapointentity.split("/")[0];
@@ -569,7 +565,10 @@ define([
569565
labels : { fontFamily : this._font }
570566
},
571567
maintainAspectRatio : this.maintainAspectRatio,
572-
showTooltips : this.showTooltips
568+
showTooltips : this.showTooltips,
569+
animation: {
570+
duration: this.chartAnimation ? 1000 : 0
571+
}
573572
};
574573

575574
return lang.mixin(lang.clone(defaultOptions), options);

src/ChartJS/widgets/DoughnutChart/DoughnutChart.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@
4747
<category>Appearance</category>
4848
<description>Switch animation on and off. Try to switch it off when you have rendering problems with multiple charts on a page</description>
4949
</property>
50+
<property key="animationDuration" type="integer" required="true" defaultValue="1000">
51+
<caption>Animation duration</caption>
52+
<category>Appearance</category>
53+
<description>Animation duration (milliseconds) for rendering (this is different from the Responsive animation duration)</description>
54+
</property>
5055
<!-- Data Source -->
5156
<property key="sourceentity" type="entity" required="true" allowNonPersistableEntities="true">
5257
<caption>Chart Entity</caption>

src/ChartJS/widgets/LineChart/LineChart.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@
6464
<category>Appearance</category>
6565
<description>Switch animation on and off. Try to switch it off when you have rendering problems with multiple charts on a page</description>
6666
</property>
67+
<property key="animationDuration" type="integer" required="true" defaultValue="1000">
68+
<caption>Animation duration</caption>
69+
<category>Appearance</category>
70+
<description>Animation duration (milliseconds) for rendering (this is different from the Responsive animation duration)</description>
71+
</property>
6772
<!-- Data Source -->
6873
<property key="sourceentity" type="entity" required="true" allowNonPersistableEntities="true">
6974
<caption>Chart Entity</caption>

src/ChartJS/widgets/PieChart/PieChart.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@
5050
<category>Appearance</category>
5151
<description>Switch animation on and off. Try to switch it off when you have rendering problems with multiple charts on a page</description>
5252
</property>
53+
<property key="animationDuration" type="integer" required="true" defaultValue="1000">
54+
<caption>Animation duration</caption>
55+
<category>Appearance</category>
56+
<description>Animation duration (milliseconds) for rendering (this is different from the Responsive animation duration)</description>
57+
</property>
5358
<!-- Data Source -->
5459
<property key="sourceentity" type="entity" required="true" allowNonPersistableEntities="true">
5560
<caption>Chart Entity</caption>

src/ChartJS/widgets/PolarChart/PolarChart.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@
4646
<caption>Animation</caption>
4747
<category>Appearance</category>
4848
<description>Switch animation on and off. Try to switch it off when you have rendering problems with multiple charts on a page</description>
49+
</property>
50+
<property key="animationDuration" type="integer" required="true" defaultValue="1000">
51+
<caption>Animation duration</caption>
52+
<category>Appearance</category>
53+
<description>Animation duration (milliseconds) for rendering (this is different from the Responsive animation duration)</description>
4954
</property>
5055
<!-- Data Source -->
5156
<property key="sourceentity" type="entity" required="true" allowNonPersistableEntities="true">

src/ChartJS/widgets/RadarChart/RadarChart.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@
4747
<category>Appearance</category>
4848
<description>Switch animation on and off. Try to switch it off when you have rendering problems with multiple charts on a page</description>
4949
</property>
50+
<property key="animationDuration" type="integer" required="true" defaultValue="1000">
51+
<caption>Animation duration</caption>
52+
<category>Appearance</category>
53+
<description>Animation duration (milliseconds) for rendering (this is different from the Responsive animation duration)</description>
54+
</property>
5055
<!-- Data Source -->
5156
<property key="sourceentity" type="entity" required="true" allowNonPersistableEntities="true">
5257
<caption>Chart Entity</caption>

src/ChartJS/widgets/StackedBarChart/StackedBarChart.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@
5757
<category>Appearance</category>
5858
<description>Switch animation on and off. Try to switch it off when you have rendering problems with multiple charts on a page</description>
5959
</property>
60+
<property key="animationDuration" type="integer" required="true" defaultValue="1000">
61+
<caption>Animation duration</caption>
62+
<category>Appearance</category>
63+
<description>Animation duration (milliseconds) for rendering (this is different from the Responsive animation duration)</description>
64+
</property>
6065
<!-- Data Source -->
6166
<property key="sourceentity" type="entity" required="true" allowNonPersistableEntities="true">
6267
<caption>Chart Entity</caption>

test/[Test] ChartJS.mpr

313 KB
Binary file not shown.

0 commit comments

Comments
 (0)