Skip to main content

I am trying to add a trend line to a bar chart. I know this inherently can't be done in Tableau, so am attempting to use the workaround as per the attached Superstore example - i.e. create a line chart on a dual axis, add a trend line to that and then make the actual line non visible.

This is all working fine until I add a breakdown dimension to the colour card (for the bar only rather than the "All" colour mark card, as I want the line chart / trend line to show the grand total). As soon as I do this, my trend line disappears.

I can't work out how this has been achieved on the attached and what I'm doing differently. Unfortunately I'm unable to share my workbook, but might be able to mock something up with dummy data where the issue can be replicated if required.

 

Thanks in advance!

8 件の回答
  1. 2025年3月7日 16:01

    Hi @Nigel Smith​ ,

     

    I find that sometimes the order in which you do things matters. I created the two charts first:

     

    Hi @Nigel Smith​ , I find that sometimes the order in which you do things matters. 

    Add the trend lines:

     

    image 

    Remove it from the bar chart

    image 

    Set the dual axis

     

    image 

    Then add colour to the bar

     

    image 

    Thanks,

    Mavis

0/9000