The Bar/Line Chart component enables you to display one or more series of data on a chart. You can use bars, lines, or a combination of the two to visualize your data. Bar charts are great for comparing two or more values that are related categorically, for example, a bar chart comparing total booking sales by region. Line charts are ideal for showing data trends and patterns over time. For example, a line chart showing monthly revenue over the course of a year.
This example demonstrates how you can use the component to create a chart with both bars and lines. It compares regional bookings between the third sales quarter and the fourth sales quarter using bars and shows the regional sales average as a trend line.
To add this Klip to your Dashboard account click this link. Example Klip - Bookings QTD
This article includes:
- A video demo
- Building with the component tree
- Building a bar/line chart
- Customizing a bar/line chart
Video demo on building a bar chart custom Klip
Watch this video for a quick demonstration on how to build a bar chart custom Klip. It uses sample data that’s included in your Klipfolio account so you can follow along.
Please note that after this video was filmed, we improved the method for adding a component and a data source to a custom Klip. After clicking Build a Custom Klip, you land in the Klip Editor where you select the Bar/Line Chart component and drag it into your Klip. Then you connect to your data by clicking +Add Data Source at the bottom of the Klip Editor window.
Building with the component tree
When you add a component to a Klip, the structure of that component is outlined in the component tree on the left. Understanding how to navigate the component tree will make it easier to customize your bar/line chart. The example below shows the component tree and Klip Editor workspace for a bar/line chart. All component trees follow the same basic structure.
When you add a bar/line chart to your Klip, you will work with the following subcomponents:
- Series: This indicates the data series you are plotting on your chart. When you click Series, you open the series’ Data, Properties, and Indicators tabs. The chart above uses four different series to compare the sales results from different ad campaigns.
- X Axis: When you click X Axis, you open the X-axis’ Data and Properties tabs. In this example, the X and Y-axes have been inverted (see Inverting the X and Y axes) and the grid lines, tick marks, and labels are hidden based on selections made in the Properties tab. Hiding different axis features can help emphasize your series data by cutting back on clutter. Select the Properties panel for the X-axis to set the format of the X-axis values as well as control grid lines, tick marks, and labels. Note that setting Label Drop to Auto only works when Label Angle is set to horizontal (---).
- Y Axis: When you click Y Axis, you open the Y-axis’ Properties tabs. In the example above the axes are inverted. Tick labels and grid lines are enabled to clarify the differences in value between the four series.
Note: You can add extra Series and Y-Axes using the buttons in the Controls palette to the right of the Klip preview workspace. To learn more about adding multiple Y-Axes, click here.
For a general introduction to the component tree go here.
How do I build a bar/line chart?
The following procedure tells you how to build a basic bar/line chart. You can apply additional customization by exploring the options in the Properties panel. For a detailed look at some of the customization options available, see How do I customize a bar/line chart?
Note: Series and X-axis values are limited to 1000 data points per Klip. Consider this when choosing a data source.
To build a bar/line chart:
- From your dashboard, click + Add a Klip > Build a Custom Klip, or, from the Klips page, click Build a Custom Klip.
- Click and drag the Bar/Line Chart component into your Klip preview workspace.
- Click + Add Data Source and select a data source to use.
- Assign data to your x-axis by clicking the X Axis subcomponent and selecting the appropriate column from the Data tab.
Note: If you are using JSON or XML data instead of tabular data, you must locate and select the appropriate element from the hierarchy. Learn more about JSON and XML data here. - Optionally, if your data set contains repeating labels or includes too many categories to display effectively, you can group your results by checking the box next to Group repeating labels or filter your results by clicking the Add Filter button. To learn more about grouping and filters, click here.
- Click the Series subcomponent and select the appropriate column from the Data panel to assign a series.
Note: If you are using JSON or XML data instead of tabular data, you must locate and select the appropriate element from the hierarchy. Learn more about JSON and XML data here. - From the Properties tab, at Format as, select the correct format for your data (for example, Currency).
- Optionally, at Chart Type, click either the Bar Chart button or the Line Chart button to change your visualization style.
- At Series Label, enter a descriptive label for your series.
Note: You can optionally add another series by accessing the Controls palette and clicking the + button next to Series or Y-Axis. - To change the title that displays on your Klip, click the Klip component in the component tree and, at Klip Title, enter your new title in the field.
- To change the name of your Klip (which displays in your list of Klips), click Untitled in the upper-left corner of the screen and enter your text in that field.
- Click Save.
How do I customize a bar/line chart?
There are many customization options available to you. Here are a few of them:
- Modifying the font size
- Applying custom colors
- Adding multiple Y-axes
- Inverting the X and Y axes
- Displaying indicators in charts
- Hiding a chart series
- Stacking series
- Enabling zoom to highlight segments of data
Modifying the font size
You can choose a font size for legends, chart values, x-axis titles, and y-axis titles in your bar/line charts.
To choose font sizes:
- Select Bar/Line Chart in the component tree.
- Click the Properties tab.
- At Chart Height, use the drop-down to select the font size for the Legend.
- Select Series in the component tree
- At Show values, select the box next to Show values on chart.
- At Value Size, use the drop-down to select a font size for the Chart Values.
- Click X Axis in the component tree.
- At Axis Title, select the box next to Show axis title.
- At Title Size, use the drop-down to select the font size to use for the X-axis Title.
- Click Y Axis in the component tree.
- At Axis Title, select the box next to Show axis title.
- At Title Size, use the drop-down to select the font size to use for the Y-axis Title.
- Click Save.
Applying custom colors
Customizing the color for each series of data can help distinguish between similar data sets and add perspective to your chart.
To apply custom colors:
- Select the appropriate Series from the tree.
- Open its Properties panel.
- At Series Color, click the box next to Override the default color.
- Use the color menu to select a new color for the series.
Note: To use a custom color, at Custom, type a hex color value in the field. - Click Save.
Adding multiple y-axes
By using multiple y-axes, you can display different, but related data sets. In the example below, the number of visitors (raw figure) is charted using the Y-axis on the left while the goal completion rate (percentage) is charted using the Y-axis on the right.
To display both series clearly in a Klip, add a secondary Y-axis and assign each series its own Y-axis. This will ensure that a different format is easily seen and that smaller values display when much larger values are plotted.
To add multiple y-axes:
- Click Bar/Line Chart in the component tree.
- In the Properties panel, at Axis, click the
Add Y-axis
button. - Right-click each y-axis in the component tree and click Rename... to provide each y-axis with a unique name.
This will make it easier to select the correct Y-axis for each series. - For each series subcomponent, navigate to Properties > Use Axis and select the appropriate y-axis from the drop-down.
Note: Your series must be added to the component tree before you can assign it to a Y-axis. You cannot assign a single series to multiple Y-axes. To add a series, navigate to the Properties panel, and, at Data Series, click the Add Series button. - Click Save.
Inverting the X and Y axes
Inverting the axes in your chart is ideal if your data set contains a single data point for each category you want to compare.
You can add the following example to your dashboard by clicking this link. It compares the cost per lead for different types of marketing engagement.
To invert the X and Y axes:
- Click Bar/Line Chart in the component tree.
- In the Properties panel, at Invert Axes, check the box next to Switch position of X and Y axes.
- Adjust the properties of the X and Y axes accordingly.
Note: For an inverted Y-axis, at Properties > Axis Position, clicking the left axis position button will display the axis at the bottom of the chart while clicking the right axis position button will display the axis at the top of the chart. - Click Save.
Displaying indicators in charts
You can set up indicators for any line or bar series in your chart. In the example below, an indicator is set to display any value over $400 as a purple bar.
To display indicators in charts:
- Select the series to which you want to apply indicators.
- Click the Indicators panel.
- Click Add.
- Set the condition for If. For example,
IF: Visits is greater than 5000
. - Set the reaction for then. For example,
then: Goals change color
.
Hiding a chart series
Choosing which series to display on your chart when you present your Klip will ensure you are highlighting the most relevant information based on your audience. To prepare your Klip for a specific audience, you can use the Properties panel to hide a series by default.
To hide a chart series:
- In the component tree, select the Series you would like to hide.
- In the Properties panel, at Visibility, select Hide this series by default.
- Click Save.
On your dashboard, the hidden series will not appear until you click the name of the series.
Stacking series
Stacking multiple, related series can help frame each data set within the total of all the data sets in a category. For example, in the chart below, the series for direct, referral, and search based visits are stacked to illustrate each traffic source’s contribution to the total number of visits to a site for a given time period.
Note that series are stacked based on their style, so bars will be stacked with other bars, and lines with other lines.
To stack series:
- Click Bar/Line Chart in the component tree.
- In the Properties panel, select the appropriate stacking option based on the style of series you want to stack (bars, lines, or areas).
- Click Save.
Enabling and using zoom to highlight data
You can enable zoom on your series charts to display specific portions of data along the X-axis, Y-axis, or both axes.
To enable zoom:
- In the Component Tree, select Bar/Line Chart.
- In the Properties panel, at Allow Zoom, click the drop-down menu and choose the zoom option you want to use.
- Click Save.
To use zoom:
- On your dashboard, highlight a portion of your chart. The selected portion will expand to allow a more granular view of your data.
- If you chose Along X axis only, click and drag your mouse pointer across your chart to highlight the data you want to expand.
- If you chose Along Y axis only, click and drag your mouse pointer up or down your chart to highlight the data you want to expand.
- If you chose Along both X axis and Y axis, click and drag your mouse pointer in any direction to highlight the data you want to expand.
- Click Reset zoom in the Klip to bring the display back to its actual size.