Category
Category plots display data values from different discrete categories.
Data Sourcing
Category plots can be created using data from tables and arrays.
Creating a Category Plot using Data from a Table
When data is sourced from a table, the following syntax can be used to create a category:
.catPlot("SeriesName", source, "CategoryCol", "ValueCol").show()
catPlotis the method used to create a category plot."SeriesName"is the name (string) you want to use to identify the series on the plot itself.sourceis the table that holds the data you want to plot."CategoryCol"is the name of the column (as a string) to be used for the categories."ValueCol"is the name of the column (as a string) to be used for the values.showtells Deephaven to draw the plot in the console.

Creating a Category Plot using Data from Arrays
When data is sourced from a array, the following syntax can be used to create a category:
.catPlot("SeriesName", [category], [values]).show()
catPlotis the method used to create a category plot."SeriesName"is the name (as a string) you want to use to identify the series on the chart itself.[category]is the array containing the data to be used for the X values.[values]is the array containing the data to be used for the Y values.showtells Deephaven to draw the plot in the console.
Categories with Shared Axes
You can also compare multiple categories over the same period of time by creating a category plot with shared axes. In the following example, a second category plot has been added to the previous example, thereby creating bar graphs on the same chart:

Subsequent categories can be added to the chart by adding additional catPlot() methods to the query. However, the plotBy() method can also be used to do this.
Note
See
plotBy(./)
Plot Styles
By default, values are presented as vertical bars. However, by using Deephaven's plotStyle() method, the data can be represented as a bar, a stacked bar, a line, an area or a stacked area.
In any of the examples below, you can simply swap out the .plotStyle() argument with the appropriate name; e.g., ("Area"), ("stacked_area"), etc.
Note
See Plot Styles
Category Plot with Stacked Bar

Multiple Sets of Stacked Category Plots
Note
This feature is currently available in Deephaven Classic, and will be coming to the web soon.
Multiple sets of stacked category plots can be created by assigning each category to a group and then applying a plot style:
