Main Content

mlreportgen.chart.BarChart Class

Namespace: mlreportgen.chart

Define a bar chart

Since R2026b

Description

Use an object of the mlreportgen.chart.BarChart class to define an interactive bar chart.

The mlreportgen.chart.BarChart class is a handle class.

Class Attributes

HandleCompatible
true
ConstructOnLoad
true

For information on class attributes, see Class Attributes.

Creation

Description

barChartObj = mlreportgen.chart.BarChart creates an empty bar chart.

barChartObj = mlreportgen.chart.BarChart(dataSet) creates a bar chart with the specified data set.

Input Arguments

expand all

This argument sets the DataSet property.

Properties

expand all

Data to be displayed by the chart, specified as an mlreportgen.chart.DataSet object.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Chart title, specified as an mlreportgen.chart.Title object. If this property is empty, the chart does not display a title.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Example: "2in"

Height of the total chart area including all chart elements, specified as a character vector or string scalar that contains a number followed by an abbreviation for a unit of measurement. Valid abbreviations are:

  • "px" — Pixels

  • "cm" — Centimeters

  • "in" — Inches

  • "mm" — Millimeters

  • "pc" — Picas

  • "pt" — Points

You can also specify pixels by omitting the unit. For example, "5" specifies 5 pixels.

Example: "5in" specifies five inches

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Width of the total chart area including all chart elements, specified as a character vector or string scalar that contains a number followed by an abbreviation for a unit of measurement. Valid abbreviations are:

  • "px" — Pixels

  • "cm" — Centimeters

  • "in" — Inches

  • "mm" — Millimeters

  • "pc" — Picas

  • "pt" — Points

You can also specify pixels by omitting the unit. For example, "5" specifies 5 pixels.

Example: "5in" specifies five inches

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Specify properties of the chart area, specified as an mlreportgen.chart.PlotArea object.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Version History

Introduced in R2026b