Options
Everything init() takes.
All options
| Option | Default | Sets |
|---|---|---|
selector |
"[data-chart]" |
The figures that become charts |
aspect |
0.38 |
The height of a chart as a share of its width. data-chart-aspect on a figure sets it for one chart. |
barfill |
0.58 |
The share of its row that a bar takes, up to --tablechart-bar-max |
ringfill |
0.42 |
The share of the radius of a donut that the ring takes |
animate |
true |
How a chart builds. false shows it whole, without animation. "grow" grows each element from zero, "sweep" reveals a line, area or donut in one movement. data-chart-animate on a figure sets it for one chart. |
entrance |
0.5 |
How far an element that animates in is in before its chart builds: 0 when it starts moving, 1 when it is in. data-chart-entrance on a figure sets it for one chart. |
labels |
"outside" |
Where the number of a column goes: "outside", above the column, or "inside". data-chart-labels on a figure sets it for one chart. |
shape |
"straight" |
How a line or area chart runs from one point to the next: "straight", "step" or "smooth". data-chart-shape on a figure sets it for one chart. |
legend |
false |
If true, the names of the lines are in a legend under the chart. data-chart-legend on a figure sets it for one chart. |
axis |
false |
If true, a column, bar, line, area or waterfall chart has numbers along its value axis. data-chart-axis on a figure sets it for one chart. |
grid |
false |
If true, a chart has a light line at each number of its value axis, or of both axes on a scatter chart. data-chart-grid on a figure sets it for one chart. |
names |
true |
If false, a scatter chart shows no names next to its markers, and the tooltip shows them. data-chart-names on a figure sets it for one chart. |
tooltip |
"auto" |
A tooltip with the values of a row that is pointed at or tapped. "auto": only on a chart that does not show all its numbers. true: always. false: never. data-chart-tooltip on a figure sets it for one chart. |
tooltipparent |
null |
Where the tooltip goes in the page: an element or a selector. By default it is the end of body. In an element that is scaled, such as the slides of a presentation, the tooltip has the same scale. |
table |
"never" |
When the table is shown under the chart: "always", only in "print", in print when the chart does not show all its numbers ("auto"), or "never". data-chart-table on a figure sets it for one chart. See Accessibility. |
totallabel |
"Total" |
The name of the total of a donut without a total row, for screen readers |
controls |
true |
Previous and Next buttons under a chart that steps. false leaves them out. See Step by step. |
previouslabel |
"Previous" |
The text of the Previous button |
nextlabel |
"Next" |
The text of the Next button |
stephint |
"step of the chart" |
Text for screen readers after the text of each button, so they hear "Next step of the chart" |
threshold |
0.5 |
How much of a chart must be in view before it builds, from 0 to 1 |
replay |
false |
If true, a chart builds again each time it scrolls back into view |
locale |
Not set | The language for numbers, such as "nl". If not set, the lang attribute of the page is used. |
langattribute |
"data-i18n" |
The attribute for translation keys. false adds no translation keys. |
debug |
false |
If true, Tablechart shows messages in the console, with how long each chart takes to build and to lay out. A chart that takes more than 50 ms gets a warning. |
Next
For the attributes on a chart, see Attributes. For what init() returns, see API.