File tree Expand file tree Collapse file tree 7 files changed +18
-9
lines changed
Expand file tree Collapse file tree 7 files changed +18
-9
lines changed Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff line change 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 } ] ,
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff 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 } ) ;
Original file line number Diff line number Diff line change 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" />
You can’t perform that action at this time.
0 commit comments