cancel
Showing results for 
Search instead for 
Did you mean: 

Line Polar Chart (Line) : Set 0 as Min value

NeilHEvotix
7 - Data Storage
7 - Data Storage

For a Polar Chart of type "Line" the UI will not allow the value of 0 as the minimum (it resets it to the minimum value from the data provided).
The other polar types - column and area allow this.

Is there a way to change this via script?polar1.PNG

3 REPLIES 3

rapidbisupport
11 - Data Pipeline
11 - Data Pipeline

Hi @NeilHEvotix ,

The script here will set the value in the design panel (widget.style.axis.min) to auto ('') and set the chart axis minimum to 0 before it is rendered. It also adds a dummy series to the chart with a value of '0' to force the minimum for the control to 0. It then disables the tool tip for this dummy series.

 

 

 

widget.style.axis.min = ''

widget.on('processresult', (w, args) => {
	args.result.yAxis[0].min = 0
	args.result.yAxis[0].autoMin = 0
	args.result.series.push({
            "name": "dummy",
            "data": [
                {
                    "y": 0
                }
            ],
            "yAxis": 0
        })
})

widget.on('beforedatapointtooltip', (a, b) => {
  if (b.context.pointScope.series.name === 'dummy') {
    b.cancel = true
  }
})

 

Let me know if this workaround works for you?

Thanks,

Daniel

[email protected]

RAPID BI

RAPID BI - Sisense Professional Services | Implementations | Custom Add-ons

Hi Daniel,

Thank you for responding.

I have tried the script, however when the chart is rendered it still has 2 at the centre.

Neil

rapidbisupport
11 - Data Pipeline
11 - Data Pipeline

Hi Neil - What version of Sisense are you running?