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. A pie takes the whole radius. |
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 or bar goes: "outside", above the column or after the bar, or "inside". data-chart-labels on a figure sets it for one chart. |
ticks |
true |
A tick above each name under a line or area chart, at the place of its row. data-chart-ticks on a figure sets it for one chart. |
values |
"auto" |
Which values a line or area chart shows: "auto", "all", "none", or a set such as "first last highest lowest outliers". data-chart-values on a figure sets it for one chart. See Which values are shown. |
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. If "toggle", a click on a name also turns its series off and on. 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. If "right", they are on the right of a column, line, area or waterfall chart. 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, if you hover over its place in the chart or tap it. "auto": only on a chart that does not show all its numbers. true: always. false: never. "crosshair": on a line or area chart, a line through the place you hover over, with its values at the side; on other charts, a tooltip. 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. |
lines |
null |
The look of each next line, instead of the 24 default looks: a list of items with marker, open and line. data-chart-lines on a figure or an element around it sets it for those charts. See Your own order. |
tablelimit |
15 |
With table: "auto", the most values a printed table has, rows times value columns. A longer table is not printed, and the summary is printed instead. See Summary. |
summary |
"auto" |
When the summary is shown: "always", only in "print", in print when the chart does not show all its numbers and its table is not printed ("auto"), or "never", for screen readers only. data-chart-summary on a figure sets it for one chart. See Summary. |
totallabel |
"Total" |
The name of the total of a donut without a total row, for screen readers |
croptext |
"Showing the last {shown} of {rows} rows. The table still contains all rows." |
The line under a chart whose first rows are cropped, with {shown} and {rows}: a text for all charts, or an object with a text per chart type and default for the others, such as { candlestick: "…", default: "…" }. data-chart-croptext on a figure sets it for one chart. See The chart will be cropped. |
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. |
transforms |
{} |
Functions that turn JSON in another structure into rows, by name. A figure picks one with data-chart-transform. See What if my API gives other JSON? |
transform |
null |
The name of the transform for every figure with data-chart-src and no data-chart-transform. |
loaderror |
"The data for this chart could not be loaded." |
The message in a figure whose data could not load. See When the data cannot load. |
debug |
false |
If true, Tablechart shows messages in the console, with how long each chart takes to build and to draw. A chart that takes more than 50 ms gets a warning. The contrast check runs without it too. See Accessibility. |
Next
For the attributes on a chart, see Attributes. For what init() returns, see API.