Additional types
The additional types
The main script has the column, bar, line, area, waterfall, donut and pie charts. The additional types are in a separate script. Maybe you do not need it, then you do not need to load it. The stylesheet is the same for all.
Right now, the scatter and candlestick charts are the additional types. More types may be added in the future.
| Type | Name |
|---|---|
| Scatter | scatter |
| Candlestick | candlestick |
With a build tool
If you use a build tool, import the type from @martinomagnifico/tablechart/additional-types, and add it with addType() before init() or create(). The first argument is the value of data-chart.
import { addType, init } from "@martinomagnifico/tablechart";
import { candlestick, scatter } from "@martinomagnifico/tablechart/additional-types";
addType("scatter", scatter);
addType("candlestick", candlestick);
init();
Only the types you import are in your bundle.
With a script tag
If you use a script tag, load tablechart-additional-types.js after tablechart.js. It adds all the additional types. It uses the code in tablechart.js, so that code is not loaded twice.
<link rel="stylesheet" href="tablechart.css">
<script src="tablechart.js"></script>
<script src="tablechart-additional-types.js"></script>
<script>
Tablechart.init();
</script>
Next
See addType() in the API.