Right-to-Left Text
Contents
Introduction
KeyLines supports multiple languages, including right-to-left (RTL) and bidirectional (BIDI) writing systems such as Arabic and Hebrew.

When KeyLines detects RTL characters, it automatically applies RTL auto support in both WebGL and Canvas to correctly display any RTL and BIDI content.
Take a look at our Multiple Languages demo to see a KeyLines chart with multiple languages.
RTL auto support mode
RTL auto support, which is applied by default in KeyLines, is a reliable approach for a large scope of cases including:
- Mixed-system texts with both LTR and RTL characters
- Complex examples containing punctuation, numbers, emojis or other special characters
- Strings with symbols in strict functional order such as e-mail addresses or URLs
This is because RTL will analyse the individual characters and assign the order dynamically so that only the identified RTL characters are in a RTL direction.
This produces the most correct output even for texts with complex combinations of characters.
Forced RTL mode in KeyLines 6.3 and earlier
Before KeyLines 6.4, forced RTL was the recommended approach in both WebGL and Canvas. This was done in one of two ways:
- By setting the HTML dir attribute to rtl on the KeyLines chart element
- By using CSS to set the direction property
While you can continue using forced RTL mode in cases where you always wish to reverse the order of the whole text, we do not recommend forced RTL for more complex texts which combine multiple direction systems with numbers and special characters. For the most versatile and reliable solution, we recommend relying on the default KeyLines RTL auto mode.