C3 AI Documentation Home

Line Chart

Create a line chart in Visual Notebooks.

Configuration

FieldDescription
Name default=Line ChartA user-specified node name displayed in the workspace
Select visualization type default=Line ChartThe type of visualization
Add data *RequiredData to plot Drag columns from the auto-populated sidebar onto the graph axes. You must drag data onto the x-axis and y-axis. Additional series and a second y-axis are optional.
Group Y axis by default=noneY-axis grouping Select a column to group by from the auto-populated dropdown menu. This is useful if you have timeseries data.
Add Grouping Filter(s) default=Select allGroups to plot Select groups to plot in the line chart. Only the groups selected are shown on the chart.

Visualization Settings

FieldDescription
Title default=noneTitle of the visualization The title is centered at the top of the chart.
Color Theme default=ColorfulVisualization color scheme Select colorful, monochrome, or grayscale.
Line Style default=SolidLine formatting Select solid or dashed.
Line Markers default=NoneSymbol on each point of the line Select dots, crosses, or none.
Line Width default=2 pxWidth of line Select 0.5 px, 1 px, 2 px, or 3 px.
Label default=noneAxis label Enter a label for the x-axis, y-axis, and secondary y-axis.
Label appearance default=RegularLabel formatting Select regular, bold, or hide.
Label font size default=RegularFont size Select regular, large, or small.
Order default=AscendingX-axis order Select ascending or descending.
Force Axis to Start at Zero default=OffY-axis range Force the y-axis to start at zero instead of the lowest point.
Include Major Lines default=OffShow grid lines Show grid lines from the y-axis.
Y-axis column labels default=name of the columnLabel for columns in the legend Enter a label for columns shown on the y-axis.
Legend size default=RegularSize of the legend Select regular, large, or small.
Legend position default=Top rightPosition of the legend on the screen Select top right, top left, bottom right, or bottom left.

Node Inputs/Outputs

InputA Visual Notebooks dataframe
OutputA line chart in Visual Notebooks

Example line chart

Figure 1: Example line chart

Examples

  • Connect a Line Chart node to an existing node.
  • Drag columns onto the x-axis and y-axis.
  • Select "Run" to create a line chart with the default settings.

Example line chart with default settings

Figure 2: Example line chart with default settings

  • The dataframe shown below is used in the remaining examples.
    • The dataframe shows fictitious prices of eggs and milk in California, New York, and Texas from 1980 to 2020.

Example input data

Figure 3: Example input data

  • You can group prices by state when charting the data. Drag the "year" column onto the x-axis, and drag the "egg_price" and "milk_price" columns onto the y-axis and the additional series section.
  • Select "state (String) from the auto-populated dropdown menu in the "Group Y axis by" field.
  • Select "Run" to create a line chart.
    • Notice that the resulting line chart has egg and milk prices over time grouped by state.

Example line chart with grouped data on the Y-axis

Figure 4: Example line chart with grouped data on the Y-axis

  • Select all "egg_price" labels in the legend to temporarily remove them from the visualization.
    • This makes it easier to examine only certain lines on the plot.

Example line chart with some data temporarily hidden

Figure 5: Example line chart with some data temporarily hidden

  • Select "Configure Visualization Settings"
  • Use these options to change the appearance of the plot.

Example line chart with custom visualization settings

Figure 6: Example line chart with custom visualization settings

Was this page helpful?