FUNCTIONS.

Usage


Examples:

InputFunctionsOutput
Placide$label().$limitStart(3,...).$toUpperCase()PLA...
[FR]France[country]$label().$replaceRegex(\\(\[a-z\]\*\\), )France
PRODUCT_fruits$label().$slice(8).$Capitalize()FRUITS
[12, 5, 3.76]$value(1).$format($0.0)$5.0
[12, 5, 3.76]$value(2).$round(1)3.8
[12, 5, 3.76]$value(0).$rankAsc().$format(0"/3 players")3/3 players

How to use the index reference:
The reference to a value or a label depends on where the function is called:

  • From the point of a graph, a bar, a part of a pie chart... by default, it uses the current index (0 for bar 1, 1 for bar 2...).

  • From an element external to the graph (title, legend, etc.), the index used is the one specified to the function as a parameter.


How to combine values and labels functions:
Value "Search" functions can be chained with label functions, for example: $max().$label().$toUpperCase() gives you the label associated with the largest value and makes it uppercase.


How to format values:
Formats are explained here.

Text functions


Functions(Params, [optional]) Description
Selection: 
$label(index) Returns the label for the current index if index not specified (or at index 0 if used outside the chart, like title or legend...).
$titleReturns the title for the current dataset (must be prefixed with $dataset(index) function).
$axis(axis) Returns the axis label for axis index . Axis could be left, right, top, bottom or radial.
Search: 
$firstReturns the first label of the current dataset.
$lastReturns the last label of the current dataset.
$minReturns the first label of the current dataset sorted alphabetically.
$maxReturns the last label of the current dataset sorted alphabetically.
Date: 
$date(formatIn, formatOut) Convert a valid date label with the formatIn format to the formatOut format.

You can find more information on day.js.

For formatIn you can also use the following:

ISO for YYYY-MM-DDT:hh:mm:ssZ ;

ISOD for YYYY-MM-DD ;

ISOT for hh:mm:ss
Functions: 
$toUpperCaseConvert the calling string to uppercase.
$toLowerCaseConvert the calling string to lowercase.
$trimRemoves whitespace from both ends of the calling string.
$trimEndRemoves whitespace from the end of the calling string.
$trimStartRemoves whitespace from the beginning of the calling string.
$capitalizeConvert to uppercase the first character of the calling string (and convert to lowercase the rest)
$capitalizeAllConvert to uppercase the first character of each word of the calling string (and convert to lowercase the rest)
$slice(start, end) Extracts a section of a string from de start index to the end index (or to the end of the string if omitted).

Zero-based index: first character is at index 0
$replace(substring, replacement) Replace the first match of the substring by the replacement string.
$replaceAll(substring, replacement) Replace all match of the substring by the replacement string.
$replaceRegex(expression, replacement, [flags]) Replace all match of the RegExp by the replacement string using the optionals flags.
$limitEnd(amount, [ellipsis]) Keep the last amount of characters of the calling string and replace it by the optional ellipsis string.
$limitStart(amount, [ellipsis]) Keep the first amount of characters of the calling string and replace it by the optional ellipsis string.

Number functions


Functions(Params, [optional]) Description
Selection: 
$dataset(index) Returns the values for the current dataset if index not specified (or at index 0 if used outside the chart, like title or legend...).

Note: should be used as a prefix to $value to enforce a specific dataset.
$category(index) Returns the values for category (i.e. values for a specific label) at index.

Note: should be used as a prefix to $value to enforce a specific category.
$stack(index) Returns the values for stack at index.

Note: should be used as a prefix to $value to enforce a specific stack.
$value(index) Returns the label for the current index of the current dataset if index not specified (or at index 0 if used outside the chart, like title or legend...).
Search: 
$first(index) Returns the first value of the current dataset, or, if specified the value at the index rank.
$last(index) Returns the last value of the current dataset, or, if specified the value at the index rank.
$min(index) Returns the first value of the current dataset sorted in ascending order, or, if specified the value at the index rank.
$max(index) Returns the last value of the current dataset sorted in ascending order, or, if specified the value at the index rank.
Math: 
$rangeThe range is the difference between the lowest and highest values.
$midRangeThe midrange is the point half way between the two most extreme values.
$medianThe median is the "middle" of a list of values.
$meanThe mean is the sum of the values divided by the number of values.
$countThe number of values (excluding null values).
$countDistinctThe number of values (excluding null values).
$countAllThe number of values (including null values).
$countAllDistinctThe number of values (including null values).
$sumThe sum of values.
$shareThe share is the value divided by the sum of values.
$rankDescRank of the value with values sorted in descending order.
$rankAscRank of the value with values sorted in ascending order.
Functions: 
$format(format) Convert the calling value to the specified format (see formats documentation).
$trunc(decimal) Remove fractional digits from the calling value up to specified decimal (default: 0)
$round(decimal) Round the calling value to the nearest value up to specified decimal (default: 0)
$ceil(decimal) Round the calling value to the largest value up to specified decimal (default: 0)
$floor(decimal) Round the largest value less than or equal to the calling value up to specified decimal (default: 0)
$absReturns the absolute value of the calling value.

Formats


Custom number formats have a specific structure. Each number format can have up to 3 sections, separated with semi-colons as follows:

  • Positive values

  • Negative values

  • Zero values

SymbolDescription
0Display insignificant zeros.
#Display significant digits.
.Decimal point. Can be personalized.
,Thousands separator. Can be personalized.
EScientific notation.
/Fraction bar
%Percent sign. Note: multiply the value by 100.
""Quotation marks. Use text in quotation marks to display it literally.
ExempleFormatOutput for: 1234567Output for: -1234567Output for: 0
Plus and minus sign+#,##0;-#,##0;01,234,567-1,234,5670
Thousands#,##0,1,235-1,2350
Millions#,##0,," M"1 M-1 M0 M
Hide zero#,##0;-#,##0;1,234,567-1,234,567
Currency Euros right (€)#,##0" €"1,234,567 €-1,234,567 €0 €
US Currency (negatives in parentheses)$#,##0;$(#,##0)$1,234,567$(1,234,567)$0
Scientific Notation0.00E+01.23E+6-1.23E+60
ExempleFormatOutput for: 1.5Output for: -1.5Output for: 0
Percentage0%150%-150%%
Fractions0/03/2-3/20
Degrees Celsius0.0#"°C"1.5°C-1.5°C0.0°C

INTEGRATION.

iFrame


The integration of your charts is possible via the use of an iFrame, you can restrict the access URLs to your charts via the editor.

Events


Make your charts interactive by collecting events triggered by:

  • a click on a chart element

  • a click on the actions bar

  • update chart ending