10 Replies Latest reply on May 14, 2018 2:14 PM by Nikhil Sahni Branched to a new discussion.

# Side-by-side bars in a dual axis chart

Hello everyone,

I am building a dual axis chart with profit as lines and number of records as stacked bars. However, I would like to have side-by-side bars instead of stacked bars for number of records, but Tableau doesn't allow me to do that without changing the whole view.

Do you know if there is any way to do this? Please find attached the workbook.

Thank you,

David

• ###### 1. Re: Side-by-side bars in a dual axis chart

David,

I can provide something but this is quite a bit tricky.

Though this is the only the way I know of.

Tableau cannot draw it with straight forward way.  Need to use some tricks.

The key is cheating the "Dates".

[Ship Date Modified]

date

(if year([Ship Date]) = 2011 then (datetrunc('month',dateadd('month',12,[Ship Date]))-5)

elseif year([Ship Date]) = 2012 then (datetrunc('month',[Ship Date])+5)

end)

Intent is year 2011 shows 1st day of month - 5 days

and year 2012 shows 5th day of each month.

Then change the Month dimension to continuous.

Thanks,

Shin

• ###### 2. Re: Side-by-side bars in a dual axis chart

Hi guys,

I would like to propose another variant,

since the little nasty perfectionist inside me

is making a noise about the lines mis-aligned.

So I decided to throw the combo chart off

(it makes not much sense to me because of

the different scales and measure units).

And I couldn't preserve the Date Axis, too. Sorry.

Yours,

Yuri

1 of 1 people found this helpful
• ###### 3. Re: Side-by-side bars in a dual axis chart

Yuriy Fal wrote:

I would like to propose another variant,

since the little nasty perfectionist inside me

is making a noise about the lines....

Me too!

--Shawn

1 of 1 people found this helpful
• ###### 4. Re: Side-by-side bars in a dual axis chart

Yuri,

Thank you for your help always !

Shin

• ###### 5. Re: Side-by-side bars in a dual axis chart

Thank you both! Both options are valid, I will check it and let you know if I have further questions

• ###### 6. Re: Side-by-side bars in a dual axis chart

You are very welcome.

Thanks,

Shin

• ###### 7. Re: Side-by-side bars in a dual axis chart

Two things to keep in mind w/combo charts:

1) They are often hard to interpret unless we add guidance and annotations on how to read them.

2) How to build them is heavily dependent on the current data structure & desired results. I wrote Bars and Lines | Drawing with Numbers to help guide people through the challenges.

Jonathan

• ###### 8. Re: Side-by-side bars in a dual axis chart

Hi Yuri,

I am not able to open your twbx file. I am using Tableau 9.3. Is your file created in a later version? Could you please share it in 9.3?

I also want to create a side by side chart combined with a line chart. Your help is appreciated.

Regards

Nikhil Sahni

• ###### 9. Re: Side-by-side bars in a dual axis chart

HI Nikhil

Downgrading to 9.3 is not easy.

i recommend that you post new thread with your own data and clear expectations.

Thanks,

Shin

• ###### 10. Re: Side-by-side bars in a dual axis chart

Hi Nikhil,

The view is made using a 'variable width bar chart' feature,

so the version 10.0+ is required to render it properly:

As a general consideration I suggest you to use

the Jonathan's tutorial (mentioned in his reply).

Yours,

Yuri