Percent

Type class

Represents a relative value. (percent)

Sources

Percent can be used (imported) via one of the following packages.

// Percent is available in all of the following modules.
// You only need to import one of them.

/**
 * --------------------------------------------------------
 * Import from: "core.ts"
 * Use like: am4core.Percent
 * --------------------------------------------------------
 */
import * as am4core from "@amcharts/amcharts4/core";

// Percent is available in all of the following modules.
// You only need to import one of them.

/**
 * --------------------------------------------------------
 * Include via: <script src="core.js"></script>
 * Access items like: am4core.Percent
 * --------------------------------------------------------
 */

Inheritance

Percent does not extend any other symbol.

Percent is not extended by any other symbol.

Properties

percent
#

Type number

Value in percent.

value
#

Type number

Relative value.

E.g. 100% is 1, 50% is 0.5, etc.

This is useful to apply transformations to other values. E.g.:

let value = 256;
let percent = new am4core.Percent(50);
console.log(value * percent.value); // outputs 128
var value = 256;
var percent = new am4core.Percent(50);
console.log(value * percent.value); // outputs 128

@readonly

Methods

constructor(

percent: number

)

#

Returns Percent

Constructor.

toString()

#

Returns string

Events

Percent does not have any events.

Adapters

Percent does not have any adapters.