Skip to content

Commit

Permalink
IDEMPIERE-6106 Performance indicator (the Gauge chart): rendering of …
Browse files Browse the repository at this point in the history
…needle is wrong when value is > the max interval (idempiere#2312)
  • Loading branch information
hengsin authored Apr 19, 2024
1 parent 7b506a3 commit 3ccb612
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions org.idempiere.zk.billboard/src/metainfo/zk/lang-addon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<language-name>xul/html</language-name>
<version>
<version-class>org.idempiere.zk.billboard.Version</version-class>
<version-uid>3.10.3.20231118</version-uid>
<version-uid>3.10.3.20240411</version-uid>
</version>
<component>
<component-name>billboard</component-name>
Expand All @@ -19,7 +19,7 @@
</component>

<stylesheet href="~./js/zul/billboard/css/billboard.css" type="text/css"/>
<javascript-module name="zul.billboard" version="3.10.3.20231118"/>
<javascript-module name="zul.billboard" version="3.10.3.20240411"/>
<!-- this js module doesn't actually exists and it is here for modern.css version -->
<javascript-module name="zul.billboard.css" version="3.10.3.20231118"/>
<javascript-module name="zul.billboard.css" version="3.10.3.20240411"/>
</language-addon>
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ public class Version {
* Returns the version UID.<br/>
* Must match with version-uid value in lang-addon.xml
*/
public static final String UID = "3.10.3.20231118";
public static final String UID = "3.10.3.20240411";
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ billboard.GaugeRenderer = class {
if (rendererOptions) {
if (rendererOptions["showNeedle"] && rendererOptions["showNeedle"] == true) {
showNeedle = true;
gauge.title = "\n{=NEEDLE_VALUE}%";
gauge.title = "\n"+wgt.getSeriesData()[1]+"%";
gauge.width = 20;
gauge.label = {
format: function(_value, _ratio, id) { return id; }
Expand Down Expand Up @@ -69,6 +69,11 @@ billboard.GaugeRenderer = class {
value: wgt.getSeriesData()[1][0]
}
};
if (rendererOptions["intervals"]) {
if (model.arc.needle.value > rendererOptions["intervals"][rendererOptions["intervals"].length-1]) {
model.arc.needle.value = rendererOptions["intervals"][rendererOptions["intervals"].length-1]+3;
}
}
model.interaction = {
enabled: false
};
Expand Down

0 comments on commit 3ccb612

Please sign in to comment.