How to Create a PixelPerfect Chart with Two Different Scales for the Y Axis

    Description: Learn how to display two measures with different units on the Y axis on the same chart. In this tutorial we'll create a chart to display category sales as a currency on the left scale and as a quantity on the right scale.

    We suggest completing the tutorials "How to Create PixelPerfect Charts" and "How to Create a Well Formatted PixelPerfect Chart" before continuing.

    Create a new PixelPerfect template and add a data source to the QlikView Chart

    Create-a-new-PixelPerfect-template-and-add-a-data-.png

     

    1. Create a new PixelPerfect report. Refer to How to Create a Simple PixelPerfect Report
    2. Set "PixelPerfect Two Scales Chart" as report name
    3. Open a new template in the editor
    4. From the connection SalesDemo, add the CH305 into the Tables node

    Create a new chart

    Create-a-new-chart.png
    1. Drag the bottom border down to increase the report area
    2. Drag and drop a chart object from the Tool Box on the right side into the template Detail area to create a new chart
    3. The Chart Wizard will be opened
    4. Select "Bar" chart and click on Next
    5. On the Appearance window click on Next: we'll use the default settings

    Set the Data Series Names

    Set-the-Data-Series-Names.png
    1. Set the name "Total Sales" for Series 1
    2. Set the name "Quantity" for Series 2
    3. With "Total Sales" selected, set "Point sort order" to Descending and "Sort points by" to Value. This will arrange the data by category from the highest "Total Sales" to the lowest
    4. Click on Next

    Total Sales Series Binding

    Total-Sales-Series-Binding.png
    1. Select the "Total Sales" series
    2. Open the "Argument" drop-down menu then double click on the "Top Sales" column from the CH305
    3. Open the "Value" drop-down menu and select the column "Total Sales". This binds the "Total Sales" series with the QlikView data

    Quantity Series Binding

    Quantity-Series-Binding.png
    1. Select the "Quantity" series
    2. In the "Argument" menu select the column "Top Sales"
    3. Set the column "Quantity" in the "Value" menu. The "(incompatible)" text disappears
    4. Click on Next
    5. Click on Next again to leave the default Chart settings

    Create a Secondary Y-Axis

    Create-a-Secondary-Y-Axis.png
    1. In the "Diagram" window select the "Elements" tab
    2. Click on "Add" in the "Secondary Y-Axis" area. This is a critical step for this tutorial
    3. The "Secondary AxisY 1" appears
    4. Click on Next
    5. Click on Next again to leave the default "Panes" options

    Set the Primary X-Axis Options

    Set-the-Primary-X-Axis-Options.png
    1. In the "Axis" window, activate the "Elements" tab
    2. Be sure to use the "Primary AxisX"
    3. Activate the flag "Visible"
    4. Activate the flag "Antialiasing"
    5. Type "Category" into the Text box

    Set the Primary Y-Axis Options

    Set-the-Primary-Y-Axis-Options.png
    1. Activate the "Primary AxisY" in the top drop-down menu
    2. Open the "Elements" tab
    3. Check "Visible"
    4. Check "Antialiasing"
    5. Type "Total Sales" in the Text box

    Set the Primary Y-Axis Number Format

    Set-the-Primary-Y-Axis-Number-Format.png
    1. Activate the "Labels" tab
    2. Select the "Auto" tab
    3. Set the format to "Currency"
    4. Set the "precision" to 0

    Set the "Secondary AxisY 1" Options

    Set-the--Secondary-AxisY-1--Options.png
    1. Activate the "Secondary AxisY 1"
    2. Open the "Elements" tab
    3. Check "Visible"
    4. Check "Antialiasing"
    5. Type "Quantity" in the Text box

    Set the "Secondary Axis Y 1" Number Format

    Set-the--Secondary-Axis-Y-1--Number-Format.png
    1. Open the "Labels" tab
    2. Select the "Auto" tab
    3. Change the Format to "Number"
    4. Set the "Precision" to 0

    Connect "Total Sales" series with "Primary AxisY"

    Connect--Total-Sales--series-with--Primary-AxisY-.png


    In the "Series View" be sure to use the "Total Sales" series and leave the default "Linked Elements". This will connect the "Total Sales" series with the "Primary AxisY".

    Connect "Quantity" series with "Secondary AxisY 1"

    Connect--Quantity--series-with--Secondary-AxisY-1-.png
    1. Switch to "Quantity" by using the drop-down menu
    2. In "Axis Y" select "Secondary AxisY 1". This will connect the "Quantity" series to the "Secondary AxisY 1"

    Remove the "Point Labels" (Values)

    Remove-the--Point-Labels---Values-.png

    1. Uncheck "Visible". This will remove the "Point Labels", or the values you see over the bars
    2. Select "Quantity" from the "Total Sales" drop-down menu
    3. Uncheck "Visible" again to remove them for both data series

     

     

    Increase chart size

    Increase-chart-size.png

     

    By using the mouse, select the bottom right corner and increase the chart size.

     

    Preview and Save

    Preview-and-Save.png

     

    Preview and Save the report as usual.