Region filter for my users


#1

Hi guys, I am using the interaction manager component in ChartFactor 1.11. My analytics engine is BigQuery. I need to always add a “region” filter behind the scenes depending on the current user. However, the interaction manager displays all current filters to users. I just don’t want region to be part of the “interaction” filters.


#2

Hi @jack, you can do this using static filters. When rendering your visualizations, set the user region as a static filter as shown below:

let filter = cf.Filter('region')	// assuming region is the name of the field
                .operation('IN')
                .value([userRegion])

let myChart = cf.provider(myProvider)
                .source(mySourceName)
                .groupby(...)
                // Here is how static filters are specified
                .staticFilters(filter)
                ...
myChart.execute()

See this link for additional information: https://chartfactor.com/doc/1.11/visualization_options/static_filters/