Categories &

Functions List

Class Definition: BubbleChart

chartjs: obj = BubbleChart (X, Y, R)
chartjs: obj = BubbleChart (…, Name, Value)

Create a BubbleChart object.

obj = BubbleChart (X, Y, R) returns a BubbleChart object, in which X and Y define the coordinates along the x-axis and y-axis, respectively, and R defines the radius for each element of the bubble chart.

  • X must be a nonempty N×P numeric matrix, where each column corresponds to a separate dataset and each row corresponds to an element of the bubble chart defining its position along the x-axis.
  • Y must be a nonempty N×P numeric matrix, where each column corresponds to a separate dataset and each row corresponds to an element of the bubble chart defining its position along the y-axis.
  • R must be a nonempty N×P numeric matrix, where each column corresponds to a separate dataset and each row corresponds to an element of the bubble chart defining its radius.

obj = BubbleChart (…, Name, Value) returns a BubbleChart object with the properties of each dataset specified by one or more Name, Value pair arguments. Name can be any property name of a BubbleData object and Value must correspond to the data type(s) and values accepted by that property. Type help BubbleData for more details on the available properties.

Specifically for the properties that accept a Color object as their input value, besides the Color object you may also parse to the BubbleChart constructor the same values accepted by the constructor of the Color object. However, if you choose to manually modify the BubbleChart’s properties using the dot notation syntax, then you must assign a Color object to the chosen property. Type help Color for more details on the available syntax.

For properties that accept scalar values, you can pass a vector of the same type with each element corresponding to a different dataset. For properties that accept vectors, you can pass a matrix of the same type with each row corresponding to a different dataset. Otherwise, the same property value will be assigned to all datasets available in data. For properties accepting a character vector, you need to pass a cellstring array for multiple datasets, whereas for properties that can take mixed types of scalar values (i.e. either boolean and character vectors), you need to pass a cell array with each element corresponding to a different dataset.

A BubbleChart object, obj, stores the following properties, which can be accessed/modified using dot notation syntax similarly to a struct object:

FieldDescription
chartIDA character vector defining the name of the Chart in the generated html code.
datasetsA cell array containing one or more BarData objects corresponding to the data input.
labelsA numeric vector or a cellstring array with the data labels defined in labels.
optionsA cell array containing one or more Option and Plugin objects. Not used at the moment.

To directly serve the BarChart object on a local web server instance, you can use the object’s webserve () method. Alternatively, you can generate and/or save to a file the corresponding HTML code with the htmlstring () and htmlsave () methods and serve it online through a web server of your choice.

See also: BubbleData, Color, Fill, Html, WebServer

Source Code: BubbleChart

Method: jsonstring

BubbleChart: json = jsonstring (obj)

Generate a JSON string with the BubbleChart’s context.

jsonstring (obj) returns a character vector, json, describing the context of the BubbleChart function in java script.

See also: BubbleChart, BubbleData