Dynamically choose a chart type

Dynamically choose a chart type

Andy Cotgreave
//

Ujval Gandhi commented on my post about dual axis formatting. He asked if you could use dual axes/parameters to choose between showing a bar and a line chart. Turns out that, yes, you can:

It’s quite a simple trick:

1. Create a Boolean parameter. I called my “Bar or Line”

2. For each measure you are displaying, create 2 calculated fields: one for the bar and one for the line. Here’s the Sales field for the bar:

3. Drop both calculated fields onto the Rows shelf, choose Dual Axes, and Synchronise them.

4. Change the Marks card to show Multiple Mark Types:

5. Set one mark to Bar and one to Line

6. Show the parameter control.

You’re done!

This is quite a nice trick, but I’m not sure why you’d want to do it. I can’t see a way it could be extended to cover other functionality. There are other ways to allow users to show multiple chart types; for example, Alan Smithee has an excellent example of this here. It’s possible that with lots of parameters and calculated fields, you could give the end user more control over what they show.

Need Expert Help?

See Our Full Menu of Data Services

InterWorks uses cookies to allow us to better understand how the site is used. By continuing to use this site, you consent to this policy. Review Policy OK

×

Interworks GmbH
Ratinger Straße 9
40213 Düsseldorf
Germany
Geschäftsführer: Mel Stephenson

Kontaktaufnahme: markus@interworks.eu
Telefon: +49 (0)211 5408 5301

Amtsgericht Düsseldorf HRB 79752
UstldNr: DE 313 353 072

×

Love our blog? You should see our emails. Sign up for our newsletter!