JSBarGraph

API for creating and configuring 2D bar graph objects.

Create a API with Module.createBarGraph.

var object = Module.createBarGraph("ID");

Function

getId() → string

Returns the object's Key.

  • Return

    • string: Successful return of the object's Key string.

    • null: If the object is null.

create(position, size, type) → boolean

Creates a 2D bar graph object.

Visualization changes based on the type input value.

  • 0: horizontal graph form.

  • 1: vertical graph form.

Name
Type
Description

position

Graph location (based on the bottom center point) coordinates (longitude, latitude, altitude).

size

Graph size (width and height settings).

type

number

Graph type setting

  • Return

    • true : Object creation successful.

    • false : Object creation failed.

  • Sample

restartAnimation(restartRate) → boolean

Restarts the graph animation.

Name
Type
Description

restartRate

number

Animation start step (values between 0.0~1.0, where 0.0 is the animation start point, and 1.0 is the end point).

  • Return

    • true : Execution successful.

    • false : If the object is not initialized or does not exist.

setValueRange(min, max, interval) → boolean

Sets the Y-axis range of the graph.

Name
Type
Description

min

number

Minimum value on the Y-axis of the graph.

max

number

Maximum value on the Y-axis of the graph.

interval

number

Grid interval of the graph.

  • Return

    • true : Object setting successful.

    • false : Object setting failed.

  • Sample

setAnimationSpeed(speed) → boolean

Sets the animation playback speed of the graph.

The speed input value should be between 0.1 ~ 1.0, with values closer to 1.0 playing back faster.

Name
Type
Description

speed

number

Graph animation playback speed

  • Return

    • true : Object setting successful.

    • false : Object setting failed.

  • Sample

setFloorColor(color) → boolean

Sets the color of the graph's floor plane.

Name
Type
Description

color

Color value.

  • Return

    • true : Object setting successful.

    • false : Object setting failed.

  • Sample

setLegendBoxSize(size) → boolean

Sets the size of the legend color display box.

Name
Type
Description

size

Box size.

  • Return

    • true : Object setting successful.

    • false : Object setting failed.

  • Sample

setUnitText(text) → boolean

Sets the unit text of the Y-axis of the graph.

Name
Type
Description

text

string

Unit text.

  • Return

    • true : Object setting successful.

    • false : Object setting failed.

  • Sample

setGridVisible(type) → boolean

Sets the visibility of the Y-axis and grid.

Name
Type
Description

type

boolean

true for Y-axis grid visibility(RTT). false to hide the Y-axis grid.

  • Return

    • true : Object setting successful.

    • false : Object setting failed.

insertLegend(name, label, color) → boolean

Adds a legend to the graph.

Name
Type
Description

name

string

Graph legend group name.

label

string

Graph legend name.

color

Graph legend color.

  • Return

    • true: Addition successful.

    • false: Addition failed.

  • Sample

insertDataSet(name, data) → boolean

Adds a data set to the graph.

Name
Type
Description

name

string

Data set name (displayed as text at the bottom of the graph).

data

List of data values (follows the order of legend addition, corresponding 1:1 with the legend).

  • Return

    • true: Addition successful.

    • false: Addition failed.

  • Sample

setDataSetNameFont(name, font) → boolean

Sets the font for the data set name text.

Name
Type
Description

name

string

Data set name.

font

string

Font name.

  • Return

    • true : Font setting successful.

    • false : Font setting failed.

  • Sample

setDataSetNameTextSize(name, size) → boolean

Sets the text size for the data set name.

Name
Type
Description

name

string

Data set name.

size

number

Text size.

  • Return

    • true : Text size setting successful.

    • false : Text size setting failed.

  • Sample

setDataSetNameTextColor(name, textcolor, textOutlineColor) → boolean

Sets the text color for the data set name.

Name
Type
Description

name

string

Data set name.

textcolor

Text fill color.

textOutlineColor

Text outline color.

  • Return

    • true : Text color setting successful.

    • false : Text color setting failed.

  • Sample

setDataSetNameInterval(value) → boolean

Sets the spacing between the graph display and the field name text.

Name
Type
Description

value

number

The spacing between the graph display and the field name text.

  • Return

    • true : Spacing setting successful.

    • false : Spacing setting failed.

  • Sample

setFloorDepth(value) → boolean

Sets the depth of the graph's floor plane in the vertical direction.

Name
Type
Description

value

number

The depth of the graph's floor plane in the vertical direction.

  • Return

    • true : Depth setting successful.

    • false : Depth setting failed.

  • Sample

Getter / Setter

getDescription(), setDescription(desc) → string

Set a description for the object.

Name
Type
Description

desc

string

Object description string.

  • Return

    • string: Successful return of the object's description string.

    • null: If the object is null.

getName(), setName(name) → string

Sets the name of the object.

Name
Type
Description

name

string

The name to set for the object.

  • Return

    • string: Successful return of the object's name.

    • null: If the object is null.

getVisible(), setVisible(visible) → boolean

Sets the visibility state of an object.

Name
Type
Description

visible

boolean

true: Make the object visible. false: Hide the object.

  • Return

    • true: Object visible state.

    • false: Object hidden state.

Last updated