Creating a PixelPerfect chart with two different scales for the Y axis
You can use the rich options of PixelPerfect to create complex charts that do not exist in the original documents. For example, you can display two measures with different units on the Y axis on the same chart. In this example, QlikView objects are used to show how to create a chart to display category sales as a currency on the left scale, and as a quantity on the right scale.
Create a new PixelPerfect template and add a chart data source
Do the following:
- Select Reports in the Qlik NPrinting main menu, and then click Create report.
- Enter a Title for the report. PixelPerfect Two Scales Chart.
- Select PixelPerfect from the Type drop-down list.
- Select an app from the App drop-down list.
- Click Create to create the report.
- Click Edit template to open the Template Editor.
- Right-click the Tables node, and select Add objects.
- Select the Connection to the QlikView document that contains the object you want.
- Select CH184 from the objects list.
Create a new chart
Do the following:
-
Drag and drop a Chart object from the Tool Box into the Detail area template.
The Chart Wizard opens.
- Select the Bar chart, and then click Next.
- In the Appearance window, click Next.
- Change the name of Series 1 to Gross Profit $ by entering it in the Series name box.
- Set Point sort order as Descending, and then set Sort points by to Value.
- Change the name of Series 2 to Gross Profit % by entering it in the Series name box.
- Click Next to open the Data window.
Bind data source
Do the following:
- In the Data window, click the Series Binding tab.
- Select the Gross Profit $ series.
- On the Argument drop-down list, expand the CH184 node, and then select the ProductName column.
-
On the Value drop-down list, select the Gross Profit column.
- Select the Gross Profit % series.
- On the Argument drop-down list, select the ProductName column.
-
On the Value drop-down list, select the GP% column.
- Click Next to open the Chart window.
- Click Next again to accept the default Chart settings, and to open the Diagram window.
Create a secondary Y-axis
Do the following:
- In the Diagram window, click the Elements tab.
-
Click Add in the Secondary Y-Axis area.
The Secondary AxisY 1 pane appears.
- Click Next.
- Click Next again to accept the default Panes settings, and to open the Axes window.
Set the primary X-axis options
Do the following:
-
In the Axes window, click the Elements tab.
- Select Primary AxisX from the drop-down list.
- Enter Product Name into the Text box.
- Select the Visibility check box.
- Select the Antialiasing check box.
Set the primary Y-axis
Do the following:
- Select Primary AxisY from the drop-down list.
- Click the Elements tab.
- Enter Gross Profit $ in the Text box.
- Select the Visibility check box
- Select the Antialiasing check box
Set the primary Y-axis number format
Do the following:
- Click the Labels tab.
- Select the Auto tab.
- Select Currency from the Format drop-down list.
- Set the Precision to 0.
Set the secondary Axis-Y 1 option
Do the following:
- Select Secondary AxisY 1 from the drop-down list.
- Click the Elements tab.
- Enter Gross Profit % in the Text box.
- Select the Visible check box.
- Select the Antialiasing check box.
Set the secondary Axis-Y 1 number format
Do the following:
- Click the Labels tab.
- Click the Auto tab.
- Select Percent from the Format drop-down list.
- Set the Precision to 1.
- Click Next to open the Series Views window.
Connect Total Sales series with primary Axis-Y
Do the following:
-
In the Series Views window, leave the default Linked Elements for the Gross Profit $ series.
This will connect the Gross Profit $ series with Primary AxisY.
Connect Quantity series with secondary Axis-Y 1
Do the following:
- Select the Gross Profit % series from the drop-down list.
-
Select Secondary AxisY 1 from Axis Y drop-down list in Linked Elements.
This will connect the Gross Profit % series to the Secondary AxisY 1.
- Click Next to open the Point Labels window.
Remove the point labels (values)
Do the following:
-
In the Point Labels window, clear the Visible check box for Gross Profit $.
This will remove the Point Labels (the values you see on the bars).
- From the top drop-down list, select Gross Profit %.
- Clear the Visible check box again.
- Click Finish to close the chart wizard.
Preview and save
Do the following:
- Click Preview.
- Check the report, close it, and then edit the template again if necessary.
- Click Save and Close to save the template and close the Template Editor.