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);
  }
 }
}
})
Version history
Last update:
‎03-02-2023 09:21 AM
Updated by:
Contributors
Community Toolbox

Recommended quick links to assist you in optimizing your community experience:

Developers Group:

Product Feedback Forum:

Need additional support?:

Submit a Support Request

The Legal Stuff

Have a question about the Sisense Community?

Email [email protected]

Share this page: