Wrapping RTL text in X-Axis does not work correctly
- Dominant language
- JavaScript
- Stars
- 9.3k
- Forks
- 1.4k
- Avg merge
- 6d 16h
- Merged PRs (30d)
- 1
Description
(P.S. Sorry for my English)
When a RTL label is splited on X-Axis, the calculation of its placement are wrong:
current status:

needs to be:

When looking on the SVG code that C3 generate, I found that chaning:
```
תנועת חיפוש
אורגאנית
```
to the following code solves the problem (I changed y instead of dy and put it in seperate text element):
```
תנועת חיפוש
אורגאנית
```
Relevant method in c3: function axis(g)
sample c3 chart with the problem (make the window small to see the word wrap:
```
var chart = c3.generate({
data: {
columns:[
["x","\u05ea\u05e0\u05d5\u05e2\u05ea \u05d7\u05d9\u05e4\u05d5\u05e9 \u05de\u05de\u05d5\u05de\u05e0\u05ea","\u05ea\u05e0\u05d5\u05e2\u05d4 \u05d9\u05e9\u05d9\u05e8\u05d4","\u05ea\u05e0\u05d5\u05e2\u05ea \u05d7\u05d9\u05e4\u05d5\u05e9 \u05d0\u05d5\u05e8\u05d2\u05d0\u05e0\u05d9\u05ea","\u05ea\u05e0\u05d5\u05e2\u05ea \u05d4\u05e4\u05e0\u05d9\u05d4"],
["cpc",39150,null,null,null],["(none)",null,6300,null,null],["organic",null,null,12000,null],["referral",null,null,null,3000]],
names:{organic:"\u05ea\u05e0\u05d5\u05e2\u05ea \u05d7\u05d9\u05e4\u05d5\u05e9 \u05d0\u05d5\u05e8\u05d2\u05d0\u05e0\u05d9\u05ea","(none)":"\u05ea\u05e0\u05d5\u05e2\u05d4 \u05d9\u05e9\u05d9\u05e8\u05d4",referral:"\u05ea\u05e0\u05d5\u05e2\u05ea \u05d4\u05e4\u05e0\u05d9\u05d4",cpc:"\u05ea\u05e0\u05d5\u05e2\u05ea \u05d7\u05d9\u05e4\u05d5\u05e9 \u05de\u05de\u05d5\u05de\u05e0\u05ea"},
type: 'bar',
groups:[["organic","(none)","referral","cpc"]],
},
axis:
{x: {show:true,type:'category',
categories:["\u05ea\u05e0\u05d5\u05e2\u05ea \u05d7\u05d9\u05e4\u05d5\u05e9 \u05de\u05de\u05d5\u05de\u05e0\u05ea",
"\u05ea\u05e0\u05d5\u05e2\u05d4 \u05d9\u05e9\u05d9\u05e8\u05d4",
"\u05ea\u05e0\u05d5\u05e2\u05ea \u05d7\u05d9\u05e4\u05d5\u05e9 \u05d0\u05d5\u05e8\u05d2\u05d0\u05e0\u05d9\u05ea",
"\u05ea\u05e0\u05d5\u05e2\u05ea \u05d4\u05e4\u05e0\u05d9\u05d4"]}},
});
```
Contributor guide
Assessment
This issue has not been assessed yet.