cancel
Showing results for 
Search instead for 
Did you mean: 
intapiuser
Community Team Member
Community Team Member
Introduction
In some cases 0 values are unnecessary and may interrupt Bar or Column Chart widgets display.
Explanation
When choosing to display 'Value Labels' some measures that contain 0's and N/A's can interrupt the display  for example:
Solution
In order to remove the 0's and N/A's please enter the following script under the widgets "edit script":
widget.on("beforeviewloaded", function (w, args) {
args.options.plotOptions.series.dataLabels.formatter = function () {
 var func = $$get(this, "series.options.mask");
 if (defined(func) && this.y > 0) {
  return func(this.y);
 } else {
  if (defined(func) && (this.y === null || this.y === 0)) {
   return "";
  } else {
   return formatWithCommas(this.y);
  }
 }
}
})
 
If you only want to exclude N/A's please enter the following script under the widgets "edit script":
widget.on("beforeviewloaded", function (w, args) {
args.options.plotOptions.series.dataLabels.formatter = function () {
 var func = $$get(this, "series.options.mask");
 if (defined(func) && this.y > 0) {
  return func(this.y);
 } else {
  if (defined(func) && this.y === null) {
   return "";
  } else {
   return formatWithCommas(this.y);
  }
 }
}
})
Rate this article:
Version history
Last update:
‎03-02-2023 09:21 AM
Updated by:
Contributors