naver / billboard.js

📊 Re-usable, easy interface JavaScript chart library based on D3.js
https://naver.github.io/billboard.js/
MIT License
5.84k stars 353 forks source link

Support for RTL languages #116

Open dodyg opened 7 years ago

dodyg commented 7 years ago

Description

http://imgur.com/a/7QVf2

Steps to check or reproduce

<html dir="rtl">

<script>
var chart = bb.generate({
--
   bindto: "#chart",
   data: {
   type: "bar",
   columns: [
   ["القاهرة",0],["الأسكندرية",47],["بورسعيد",0],["السويس",0],["دمياط",428],["الدقهلية",2218],["الشرقية",2268],["القليوبية",1517],["كفر الشيخ",1340],["الغربية",1740],["المنوفية",166],["البحيرة",2468],["الاسماعيلية",248],["الجيزة",1700],["بني سويف",117],["الفيوم",1332],["المنيا",2261],["اسيوط",1674],["سوهاج",1971],["قنا",1355],["اسوان",464],["البحر الأحمر",11],["الوادي الجديد",62],["مطروح",74],["شمال سيناء",93],["جنوب سيناء",56],["الاقصر",383],                ]
   }
  });
</script>

Is there any support or workaround to handle RTL?

netil commented 7 years ago

thanks @dodyg for sharing this issue. Honestly speaking, we didn't took that in consideration before.

The main issue will be adjustment of contents, right? I think that can be fulfilled creating a new stylesheet for RTL languages.

Could you share more thoughts about that? Illustrating what will be the correct support for RTL languages.

dodyg commented 7 years ago

RTL languages are mostly Arabic, Farsi, Urdu and Hebrew.

With RTL languages usually you have to pay attention to the margin/padding right/left situation.

netil commented 7 years ago

@dodyg, would you mind contribute for RTL languages? Since we don't have experience treating RTL langues. So, it'll be great for RTL users if this feature is provided.

netil commented 7 years ago