I am using Highcharts, I am facing a problem in Pie Charts for Arabic. Its working fine for English. I tried rtl & ltr but its not working.
var chart = new Highcharts.Chart({ chart: { renderTo: 'container', type: 'pie' },
title: {
text: 'یک نمودار؟!',
useHTML: true, //bug fixed `IE9` and `EDGE`
style: {
fontSize: '20px',
fontFamily: 'tahoma',
direction: 'rtl',
},
},
tooltip: {
useHTML: true,
style: {
fontSize: '20px',
fontFamily: 'tahoma',
direction: 'rtl',
},
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
y: -5, //Optional
format: '\u202B' + '{point.name}', // \u202B is RLE char for RTL support
style: {
fontSize: '15px',
fontFamily: 'tahoma',
textShadow: false, //bug fixed IE9 and EDGE
},
},
},
},
series: [{
name: 'برند',
colorByPoint: true,
data: [{
name: 'الحجم الفعلي',
y: 56.33
}, {
name: 'خرسانة جاهزة',
y: 24.03,
}, {
name: 'خرسانة جاهزة',
y: 10.38
}, {
name: 'سفاری؟!',
y: 4.77
}, {
name: 'اوپرا؟!',
y: 0.91
}, {
name: 'دیگر؟!',
y: 0.2
}],
}],
});
Example is here https://jsfiddle.net/NabiKAZ/h4kv0t9v/4/
In plotOption
add useHTML: true,
Forked Fiddle
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
y: -5, //Optional
format: '\u202B' + '{point.name}', // \u202B is RLE char for RTL support
style: {
fontSize: '15px',
fontFamily: 'tahoma',
textShadow: false, //bug fixed IE9 and EDGE
},
useHTML: true,
},
//showInLegend: true,
},
},
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With