cancel
Showing results for 
Search instead for 
Did you mean: 
intapiuser
Community Team Member
Community Team Member
Introduction
This article explains how to center the zero intersect of a bar chart.  This can be done manually be setting the axis min/max, but this solution provides a way to do this dynamically.
Steps

STEP 1 - ADD THE PLUGIN

Download the attachment and unzip the contents into your C:\Program Files\Sisense\PrismWeb\plugins\ folder. If you are using version 7.2 and higher unzip the contents into your C:\Program Files\Sisense\app\plugins\ folder. If the plugins folder doesn't exist, just create it. After those files have been unzipped there, you may also have to restart the web server. Now, when you create a new bar chart the settings menu should contain an option for centering the zero intersect.

STEP 2 - CREATE THE CHART

Create a bar chart that has at positive and negative values.  In the Widget Editor, open the settings menu (see image above) for the widget and check the option under Center Zero Intersect to Enabled.  This will make sure the zero intersect is centered on the chart.  You can also check the option to Show Plotline, that will draw a black line on the chart to highlight the zero intersect.
References/Notes
  • This plugin is built for bar charts.
  • Also added an option to set offsets based on a percentage.  The default is to center the x-axis at zero, but you can instruct the chart to just shift the offset in either direction based on a percentage.  Some default percentages are included, but if you want to add your own just open up centerZeroIntersect.js and modify the percentOptions array on line 10.
Rate this article:
Comments
LM
7 - Data Storage
7 - Data Storage

Hello,

Thanks for sharing the plugin. We have used it in our widget since we had a similar requirement. It worked fine in the widget on it's own but when we apply certain filters it seems to run into a problem.

For certain dashboard filter selection; the negative values in the widget are appearing on the right side of the center axis which is not the desired result.

We have kept the plugin settings as below:

LM_0-1681459205953.png

On drill-down filtering the dashboard from another widget; in this widget we get the result negative value on right-side of the center axis. 

LM_0-1681459965365.png

As far as we've seen, this seems to be happening randomly for some filter selections. In some cases it works fine and in others it doesn't. 

 Would be great if you could provide some insight on the cause behind this if you are aware. And any possible resolution. 

Thanks and Regards,
LM

Version history
Last update:
‎03-02-2023 09:04 AM
Updated by:
Contributors