cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Can in-cell charts in SAC tables be enable/disabled using script?

VivekD
Explorer
0 Likes
793

While In-cell charts look great and help pop out numbers visually, sometimes users may not want it.  

Is there a way to control the in-cell charts via a script?

Accepted Solutions (1)

Accepted Solutions (1)

Ivan_Camac
Participant

Hi,

There is no direct API currently to enable or disable in-cell charts via script. However, in-cell charts are tied to a measure. Therefore, you can clone your measure (just create a calculated measure directly referencing the other measure) and then only enable in-cell charts for one of them. Then in your script, you can simply toggle between the two measures by setting a filter on the measures dimension.

For example, simple code for a switch widget might look like:

if (this.isOn()) {
	Table_1.getDataSource().setDimensionFilter(Alias.MeasureDimension,"Amount");
} else {
	Table_1.getDataSource().setDimensionFilter(Alias.MeasureDimension,"11533541-0732-4718-3719-721854309968");
}

This way you still only have one table widget, but the user just sees the in-cell charts toggle on or off.

Cheers, Ivan.  

VivekD
Explorer
0 Likes
That looks like a pretty decent option considering there is no API. Thanks.

Answers (1)

Answers (1)

N1kh1l
Active Contributor
0 Likes

@VivekD 

I do not think there is an API to toggle on and off the in cell charts. If its really important for end user experience, You could superimpose 2 tables one with in cell charts enabled and other without it and then you can hide and unhide the table based on if in cell chart is required or not. But again only do this if its really a pressing requirement. as 2 tables will have an impact on performance.

Hope this helps !!

Nikhil