Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Change Line Chart to Bar based on condition

I have a line chart that sometimes only has one data point depending on which year or years are selected as my dimension.

I want the chart to automatically change to a bar chart when there is only one data point and be a line chart when more than one year is selected.

I do now want to create a separate chart, nor do I want to hit a button to make the change.   I want to write a condition that will change the chart automatically as my end user works in the production app.

Hope someone has done this already and can help.

Thanks,

line chart with 1 data point.PNG

1 Solution

Accepted Solutions
jsakalis
Contributor III
Contributor III

How about the attached method.

It conditionally shows a line or bar chart based on 1 or not 1 year.

View solution in original post

3 Replies
jsakalis
Contributor III
Contributor III

How about the attached method.

It conditionally shows a line or bar chart based on 1 or not 1 year.

Anonymous
Not applicable
Author

That looks like a good option.  Let me play with it and see how it works in my app

Anonymous
Not applicable
Author

Thanks for your quick reply John.  Once I changed my chart to a combo chart, I was able to do exactly what I wanted to do.  Every day I learn something new visiting this forum.