How to Use the Line Chart


To apply coloring (split in categories):

  1. On the authoring bar, click to open the Data in analysis flyout.

  2. In the flyout, drag the column you want to color by to the center of the visualization.

    Response: Drop targets are shown in the middle of the visualization.

  3. Drop the column on the Color target.

    Response: The lines are colored with one color for each category in the selected column. If the lines have not been previously split by adding a Line By column, the lines will be split according to the color categories.

    Comment: To learn more about coloring in Spotfire, see Coloring Overview.

To mark parts of the line:

  1. Drag with the mouse around the part of the line you want to mark.

    Response: If one node in the line is included when you drag, that node will be marked. If two or more adjacent nodes are included, the line between the nodes will also be marked, but if there are nodes in between which are not included, only the separate nodes will be marked.

    Comment: You can select several nodes in different parts of the line by pressing Ctrl and click and drag with the mouse.

To mark an entire line:

  1. Click once anywhere on the line, or, if the lines are split by color, click the category corresponding to the line under Color by in the legend.

To use multiple columns on one axis:

This is an example of how to use two columns on the Y-axis. Each column will be represented by a colored line.

  1. On the Y-axis, click the plus sign (Add one more column) next to the column selector.

  2. Select a new column from the menu.
    Comment: A column can also be dragged from the Data in analysis flyout or the Filters panel.

  3. In the legend, select (Column Names) in the Color by drop down list.
    Response: The lines are colored with one color for each column.
    Comment: For more information on (Column Names), see the Non-Column Selections page.

To split lines without coloring:

  1. In the Data in analysis flyout, drag the column you want to split the lines by to the center of the visualization.

    Response: Drop targets are shown in the middle of the visualization.

  2. Drop the column on the Line by target.
    Response:The lines are split into one line for each category in the selected column, unless coloring has already split the lines in a more granular way.
    Comment: It is also possible to combine a Line By action with a Color By, so that the lines are split by one category and colored by another.

To add a reference line to the line chart:

  1. Right-click the visualization to display the pop-up menu.

  2. Select Properties.

  3. Go to the Lines & Curves page.

  4. Select the check box for any of the default lines or click Add to define a new horizontal or vertical line.

    Comment: You can only add lines to the X-axis when it is in continuous mode. Right-click the scale labels, and select Continuous Scale from the pop-up menu.

To add more than one scale to the Y-axis:

When the measures on the Y-axis are of completely different magnitudes, you might benefit from using more than one scale on the axis.

  1. Right-click the Y-axis, and select Dual scales or  Multiple Scales from the pop-up menu.

    You can also go to the Y-axis page in the Visualization Properties dialog and click the Dual scales or Multiple scales radio button. This is also where you change the settings for the different scales and determine whether a certain scale should be located on the left or the right side.

  2. Comment: If you are using values from different columns on the various scales, you can also use drag columns from one side to another.

To add a curve fit to the line chart:

  1. Right-click the visualization to display the pop-up menu.

  2. Select Properties.

  3. Go to the Lines & Curves page.

  4. Click Add and select a suitable curve fit from the drop-down menu.

    Comment: You can select from a number of predefined curve fits, or define your own curve using Curve Draw. See Curve Fit Models for more information about the different options.

  5. Once the curve has been created, you can change its settings on the Lines & Curves page. Some of the curve settings are also available from the pop-up menu in the visualization.

To add error bars to the line chart:

  1. Right-click the visualization to display the pop-up menu.

  2. Select Properties.

  3. Go to the Error Bars page.

  4. In the Visible error bars list, select the column or measure to use, and select the check box next to it.

    Response: The settings for the selected column or measure will be displayed in the lower part of the dialog.

    Comment: Only columns and measures with numerical values are listed.

  5. To define an upper error, choose a column or measure in the Upper error column selector. To define a lower error, choose a column or measure in the Lower error column selector.

    Response: The defined error bars are shown in the visualization.

    Comment: Error bars can only be used on numerical values.

    Note: Error bars cannot be added to line charts with percentage scaling. Therefore, line charts using individual scaling for each line cannot be combined with error bars.

To create a new line chart:

  1. On the authoring bar, click    to open the Visualization types flyout.

  2. Drag the Line chart visualization to the wanted position on the analysis page.

    Response: A first attempt to set up a suitable line chart is made.

  3. Adjust the line chart to display the categories and measures of your choice.

    Comment: For more information about how to change what to show on the two axes, see Column Selectors.

See also:

What is a Line Chart?

Line Chart Properties