Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Accessing chart type from an expression in order to change expression background colour

Dear Qlik Community,

Can anyone tell me if there is a way of ascertaining which chart type is currently selected via script / functions in the background colour expression/script window.

i.e. I have a line chart that allows quick change to be a table to view the data behind it. The colour of the lines are set by using an rgb() value in the background colour section under each of the expressions of the chart....each of the lines now has a lovely dark bold colour and are easy to read, however when switching to table view, the dark colour is then the background colour to the columns of data... which makes it harder to read.

One would want the table to have white background and dark text and the line chart to remain having the nice bold colours.

A solution already suggested to me is to have 2x expressions for every one & hide the version with bold colour from table and hide the white background colour from the line charts..... the downside clearly being it doubles the maintenance if any of the expressions have to change in future / it may be confusing to developers looking at the setup in future.

Thus is there a way of doing something like the following?:

IF(ChartTypeSelected = "LineChart", rgb(105,16,173), rgb(255,255,255))

or the reverse:

IF(ChartTypeSelected = "Table", rgb(255,255,255), rgb(105,16,173))

Kind Regards, Mike

2 Replies
sunny_talwar

AFAIK there is no function available in QlikView to determine the type of chart you are on. May be there is a Macro that you might be able to employee, but I won't know because I have very limited knowledge of Macros.

gsbeaton
Luminary Alumni
Luminary Alumni

I would love a GetActiveChartType([ObjectID]) function in QlikView, but alas it does not exist.  We have had to make do with creating multiple variants of a single chart and conditional hide/show buttons.  I also make use of variables with a value set to 1 or 0, based on whether or not a chart is active to help control styling.  It's not pretty and it's not great for maintenance, but it works!

Kind regards

George