Skip to content

Commit 0bbe34f

Browse files
committed
Fix merge conflicts
Fix merge conflicts
2 parents 445be96 + c2a7ded commit 0bbe34f

File tree

7 files changed

+18
-9
lines changed

7 files changed

+18
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ChartJS",
3-
"version": "3.1.4",
3+
"version": "3.3.0",
44
"description": "This widget is a wrapper for the ChartJS library and you can use it to visualize your aggregated data.",
55
"license": "Apache License, Version 2",
66
"author": "Mendix",

src/ChartJS/lib/charts.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4685,10 +4685,6 @@
46854685
id: 'x-axis-0'
46864686
}],
46874687
yAxes: [{
4688-
ticks:{
4689-
callback:function(value){
4690-
return Number(value).toFixed(3);
4691-
}},
46924688
type: "linear",
46934689
id: 'y-axis-0'
46944690
}],

src/ChartJS/widgets/LineChart/LineChart.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@
177177
<attributeType name="Decimal"/>
178178
</attributeTypes>
179179
</property>
180+
<property key="roundY" type="string" required="true" defaultValue="-1">
181+
<caption>Round Y value</caption>
182+
<category>Data Point</category>
183+
<description>Number of decimals to round the value on the Y-axis. Disable it by setting it to '-1'</description>
184+
</property>
180185
<!-- Behavior -->
181186
<property key="onclickmf" type="microflow" required="false">
182187
<caption>On Click Microflow</caption>

src/ChartJS/widgets/LineChart/widget/LineChart.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,18 +132,26 @@ define([
132132
labelString: (this.yLabel !== "") ? this.yLabel : "",
133133
fontFamily: this._font
134134
},
135-
ticks : { fontFamily: this._font }
135+
ticks : { fontFamily: this._font,
136+
callback: lang.hitch(this, function(value){
137+
var round = parseInt(this.roundY);
138+
if (!isNaN(round) && round >= 0) {
139+
return Number(value).toFixed(round);
140+
}
141+
return value;
142+
}) }
136143
}],
137144
xAxes: [{
138145
scaleLabel: {
139146
display: (this.xLabel !== "") ? true : false,
140147
labelString: (this.xLabel !== "") ? this.xLabel : "",
141148
fontFamily: this._font
142149
},
150+
type: "category",
151+
id: "x-axis-0",
143152
ticks : { fontFamily: this._font, }
144153
}]
145154
},
146-
147155
responsive : this.responsive,
148156
responsiveAnimationDuration : (this.responsiveAnimationDuration > 0 ? this.responsiveAnimationDuration : 0),
149157
tooltips : {
@@ -211,7 +219,7 @@ define([
211219
maintainAspectRatio : this.maintainAspectRatio,
212220

213221
// Custom tooltip?
214-
customTooltips : false //lang.hitch(this, this.customTooltip)
222+
customTooltips : false, //lang.hitch(this, this.customTooltip)
215223

216224
}
217225
});

src/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<package xmlns="http://www.mendix.com/package/1.0/">
3-
<clientModule name="ChartJS" version="3.1.4" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="ChartJS" version="3.3.0" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="ChartJS/widgets/BarChart/BarChart.xml"/>
66
<widgetFile path="ChartJS/widgets/LineChart/LineChart.xml"/>

test/[Test] ChartJS.mpr

6 KB
Binary file not shown.

test/widgets/ChartJS.mpk

78 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)