Highcharts不显示阿拉伯语饼图的数据标签

时间:2017-05-20 05:55:57

标签: highcharts

我正在使用Highcharts,我在Pie Charts中面临阿拉伯语问题。它适用于英语。 我试过rtl& ltr但它不起作用。

var chart = new Highcharts.Chart({     图表:{         renderTo:' container',         类型:'馅饼'     },

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
    }],
}],

});

示例在这里https://jsfiddle.net/NabiKAZ/h4kv0t9v/4/

1 个答案:

答案 0 :(得分:8)

plotOption添加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,
    },
},