3 Replies Latest reply on Aug 19, 2016 10:18 AM by Mikhail Christiansen

    Toggling Line Chart On & Off and Not Showing Zero on Axis

    Mikhail Christiansen

      Hello everyone,

       

      I have searched all over for an answer to this. I have seen similar posts, but nothing that directly addresses this rather specific question.

       

      I have a chart that has a bar chart and line chart. The line chart can be toggled on and off.

       

       

      My shelves look like this:

      with the columns being a date and the rows being two different measures. The second one CNT(New....) is the one that I toggle on and off.

       

      I have two issues with this chart that relate to one another. The first is that when I toggle the CNT(New...), I want it to not show any values on the axis and it currently shows a zero. Also,

      I would like to have the line chart be in front of the bar chart, but when I switch my measures on the rows shelf and toggle off the CNT(New...), I get a white line that cuts across my chart.

       

       

      I am not sure why this is happening because the formula for the toggle reads as "IF [Pool Count] = TRUE THEN [New_Iss_greaterthan_zero] ELSE NULL END" so I thought it should all be NULL values, not zeros.

       

      Can someone please help me figure out how to make the line completely disappear instead of cutting across my viz and also not have the zero show up on the axis?

       

      Thank you!

        • 1. Re: Toggling Line Chart On & Off and Not Showing Zero on Axis
          Darren Evans

          Hi Mikhail,

           

          I can help here.

           

          When you first created this chart and toggled your parameter to false you likely saw a warning that stated that there were 'X nulls' in the view. Something like this:

           

          Screen Shot 2016-07-29 at 09.45.41.png

           

          If you click on this warning you get two options:

           

          Screen Shot 2016-07-29 at 09.45.47.png

           

          Filtering the data would make your chart blank as all months containing a null would be excluded. This is clearly not right for you.


          Show data at the default position will convert all null values to a 0 showing a 0 line on your axis. This is what I believe has been applied and is causing the line to show on your chart.

           

          If you do a quick rebuild and instead of left clicking the null warning - right click it. This will allow you to hide the indicator tidying up your visual without causing the 0 line to show.

           

          With regard to the axis, I am not sure you can dynamically hide the axis marks when you choose not to show the line. I would be tempted to right click the axis and de-select 'Show Header'

           

          Screen Shot 2016-07-29 at 09.58.05.png

           

          and then use labelling to show min and max values for the line:

           

          Screen Shot 2016-07-29 at 09.59.08.png

           

          This would give the user a scale on the line but would remove the axis. I appreciate this is not a complete solution on the axis but believe this to be the best way to display the data.

           

          Darren

           

          www.interworks.co.uk

          • 2. Re: Toggling Line Chart On & Off and Not Showing Zero on Axis
            khalid norat

            Hi Mikhail,

            do you have a sample workbook.

             

            There are multiple ways of fixing this issue.

             

            Using parameter to switch your marks so it is at the bottom or top,

             

            Synching axis,

             

            using reference lines.

             

            If you have something to share I can demonstrate the different possible methods on your workbook.

             

            even If you recreate something similar on superstore data this would also help.

             

            Khalid

            • 3. Re: Toggling Line Chart On & Off and Not Showing Zero on Axis
              Mikhail Christiansen

              Hi Darren,

               

              Thank you for your response. I thought I had right clicked, but I might be mistaken. I tried recreating the chart, but since it uses the same variables and filters, it did not give me the option to choose how I wanted to treat the Nulls. Is there any other way to view that option again or change the setting somewhere within Tableau / the XML?

               

              Best,

              Mikhail