9 Replies Latest reply: Jan 6, 2017 9:48 AM by Patrick routier RSS

    How can I combine a Stacked Bar and a Line Graph on one chart

      I have two charts which I would like to combine onto one QlikView Sheet Object ( see images below ).

      I set Chart Properties > Dimensions YEAR and GENDER

      with a count(ID) Expression which provides the Stacked Bar perfectly.

       

      However, when I add the Expression AGE with Trendline = Average, I get no option to choose Display Options = Line. It is dimmed out.

      The problem is that when I add the AGE expression, I lose my Stacked Bar in each Gender splits into its own bar. Not sure why.

      My data table has fields ID, YEAR, GENDER and AGE.

      Any suggestions ?

      error loading imageerror loading image

        • How can I combine a Stacked Bar and a Line Graph on one chart
          John Witherspoon

          I believe this was asked pretty recently, and I believe the answer was "you can't". About the best you can do, if you MUST have it look that way, is to build two charts, make the top one transparent, and line them up manually to look like a single chart. You'll need to make sure they always display the exact same X values, and have the exact same range of Y values for the axis.

          I believe there's a request on the customer portal to support this kind of chart. If you have access to the customer portal, you could go in and promote that request to make it that little bit more likely that QlikTech will provide a solution that little bit sooner.

            • How can I combine a Stacked Bar and a Line Graph on one chart

              Ouch - so there is no combining of a Stacked Bar chart with one or more Lines. Shame.

              Oh well - I will take your "workaround" advice and attempt to combine the two charts by making the Line Chart background transparent.

              I assume I will need to get into some sort of event programming to keep the scales and chartsize aligned as the non-transparent chart is resized and rescaled.

              Thanks though - I'll jump in and see how all of that is done.

                • How can I combine a Stacked Bar and a Line Graph on one chart
                  John Witherspoon

                   


                  sungrebe wrote:I assume I will need to get into some sort of event programming to keep the scales and chartsize aligned as the non-transparent chart is resized and rescaled.


                  I'd personally just uncheck "Allow Move/Size" on the Presentation tab. There might be a way to use macros to keep them in sync, but it sounds like a whole lot of trouble for very little benefit if it's even possible. Plus when you use a macro, QlikView flushes its buffers, so it can impact performance.

                  And I just noticed that you're using separate axes - one a %, one a number. So you don't have to worry about lining up the Y axis values, only the X axis values. That makes it easier.

              • How can I combine a Stacked Bar and a Line Graph on one chart

                Create a combo chart. One with line chart dimensions on left-bottom axis and the other bar or a stacked bar with dimension on right-top. The check boxes are available in the presentation tab. choose combo, line and bar check boxes from the general tab.

                But i have adifferent issue. In a single chart i have to create a bar chart for the total expression at national level and line charts for regional level. I can show them in seperate charts but the requirement is to show them in a single chart. In addition I have to show anothe line for goals values that is only at nation level. no link with regions. If i bring them as variables in my script from the resident tables, how can i put all these values into a table so that i can use that cross table for creating this single graph. the values should look like this

                w x y z

                Goal v1 v2 v3 v4

                region v5 v6 v7 v8 --- 5 rows like this. I can sum thes 5 rows to get the national values.

                My question is how to load variables that i create using SET and bringing values from the resident tables for the regions.

                I mean some how if iget values v1 to v8 or more. how to load them internally into a table as above.

                I must have used more words to explain than necessary.

                  • How can I combine a Stacked Bar and a Line Graph on one chart
                    John Witherspoon

                     


                    MahanMurthy wrote:Create a combo chart. One with line chart dimensions on left-bottom axis and the other bar or a stacked bar with dimension on right-top. The check boxes are available in the presentation tab. choose combo, line and bar check boxes from the general tab.


                    I can't make that work for me. As soon as I add the second expression, the Subtype radio button on the Style tab goes away, and the bars unstack. Am I missing something simple? Can you post an example?

                  • Re: How can I combine a Stacked Bar and a Line Graph on one chart
                    Patrick routier

                    Hello,

                    I'm in front of the same issue.. is someone have a solution , Workaround ?

                     

                    thx.