Type module
Sources
Items from Instance can be imported/included and used via following ways.
/** * -------------------------------------------------------- * Import via: Instance.ts * Access items like: $instance.myVariable * $instance.myFunction() * -------------------------------------------------------- */ import * as $instance from "@amcharts/amcharts4/Instance";
Variables
Instance does not have any variables.
Functions
addLicense( license: ) |
Returns Adds a license, e.g.: am4core.addLicense("xxxxxxxx"); am4core.addLicense("xxxxxxxx"); Multiple licenses can be added to cover for multiple products. @since 4.5.16 |
---|---|
addToQueue( sprite: ) |
Returns |
create( htmlElement: ) |
Returns A shortcut to creating a chart instance. The first argument is either a reference to or an id of a DOM element to be used as a container for the chart. The second argument is the type reference of the chart type. (for plain JavaScript users this can also be a string indicating chart type) let chart = am4core.create("chartdiv", am4charts.PieChart); // Can pass in chart type reference like this: var chart = am4core.create("chartdiv", am4charts.PieChart); // ... or chart class type as a string: var chart = am4core.create("chartdiv", "PieChart"); |
createChild( htmlElement: ) |
Returns Creates all HTML and SVG containers needed for the chart instance, as well as the new |
createDeferred( callback: ( args: ) |
Returns Useful in creating real queues form mult-chart creation. Accepts a reference to a function which crates and returns actual chart object. It returns a am4core.createDeferred(function(div) { // Create first chart let chart = am4core.create(div, am4charts.XYChart); // ... return chart; }, "chartdiv1").then(chart) { // <code>chart</code> variable holds an instance of the chart console.log("Chart ready", chart); } am4core.createDeferred(function(div) { // Create second chart let chart = am4core.create(div, am4charts.PieChart); // ... return chart; }, "chartdiv2").then(chart) { // <code>chart</code> variable holds an instance of the chart console.log("Chart ready", chart); } am4core.createDeferred(function(div) { // Create first chart var chart = am4core.create(div, am4charts.XYChart); // ... return chart; }, "chartdiv1").then(chart) { // <code>chart</code> variable holds an instance of the chart console.log("Chart ready", chart); } am4core.createDeferred(function(div) { // Create second chart var chart = am4core.create(div, am4charts.PieChart); // ... return chart; }, "chartdiv2").then(chart) { // <code>chart</code> variable holds an instance of the chart console.log("Chart ready", chart); } Click here for more information |
createFromConfig( config: ) |
Returns A shortcut to creating a chart from a config object. Example: let chart am4core.createFromConfig({ ... }, "chartdiv", am4charts.XYChart ); var chart am4core.createFromConfig({ ... }, "chartdiv", "XYChart" ); If { "type": am4charts.XYChart, // ... } { "type": am4charts.XYChart, // ... } Or via string: (if you are using JavaScript) { "type": "XYChart", // ... } { "type": "XYChart", // ... } A If { "type": "XYChart", "container": "chartdiv", // ... } { "type": "XYChart", "container": "chartdiv", // ... } @todo Throw exception if type is not correct |
disposeAllCharts() |
Returns Disposes all of the currently active charts. |
processNextDeferred() |
Returns |
queueHandler( sprite: ) |
Returns |
removeFromQueue( sprite: ) |
Returns |
unuseAllThemes() |
Returns Removes all "active" themes. Any charts created subsequently will not have any theme applied to them. |
unuseTheme( value: ) |
Returns Removes a theme from "active themes" list, so it won't get applied to any charts created subsequently. |
useTheme( value: ) |
Returns Applies a theme to System, and subsequently all chart instances created from that point forward. amCharts supports multiple themes. Calling This enables combining features from multiple themes on the same chart. E.g.: am4core.useTheme(am4themes.material); am4core.useTheme(am4themes.animated); am4core.useTheme(am4themes.material); am4core.useTheme(am4themes.animated); The above will apply both the Material color and animation options to all charts created. |
viewPortHandler( sprite: ) |
Returns Checks whether the chart was not initialized fully due to setting of @since 4.9.12 |