Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/436.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何编辑highchart标签的html?_Javascript_Jquery_Html_Css_Highcharts - Fatal编程技术网

Javascript 如何编辑highchart标签的html?

Javascript 如何编辑highchart标签的html?,javascript,jquery,html,css,highcharts,Javascript,Jquery,Html,Css,Highcharts,我有一个标签,标签格式如下: {point.name} <div class="pct">{point.percentage:.2f}%</div> JS .pct { color: blue; font-size: 8px; } $(function () { $('#container').highcharts({ plotOptions: { pie: { curso

我有一个标签,标签格式如下:

{point.name} <div class="pct">{point.percentage:.2f}%</div>
JS

.pct {
    color: blue;
    font-size: 8px;
}
$(function () {
    $('#container').highcharts({
        plotOptions: {
            pie: {
                cursor: 'pointer',
                dataLabels: {
                    enabled: true,
                    format: '{point.name} <div class="pct">{point.percentage:.2f}%</div>'
                }
            }
        },
        series: [{
            type: 'pie',
            data: [
                ['Firefox',   45.0],
                ['IE',       26.8],
                {
                    name: 'Chrome',
                    y: 12.8,
                    dataLabels: {  
                        style: {
                            color: "#ff0000",
                            fontFamily: 'serif',
                            fontSize: '17px'
                        }
                    }
                },
                ['Safari',    8.5],
                ['Opera',     6.2],
                ['Others',   0.7]
            ]
        }]
    });
});
$(函数(){
$(“#容器”)。高图({
打印选项:{
馅饼:{
光标:“指针”,
数据标签:{
启用:对,
格式:'{point.name}{point.percentage:.2f}%'
}
}
},
系列:[{
键入“pie”,
数据:[
['Firefox',45.0],
[IE',26.8],
{
名称:“Chrome”,
y:12.8,
数据标签:{
风格:{
颜色:“ff0000”,
fontFamily:'衬线',
字体大小:“17px”
}
}
},
[Safari',8.5],
[Opera',6.2],
[“其他”,0.7]
]
}]
});
});

类似乎已被删除,但您可以执行以下操作:

                format: '<b >{point.name}</b>:<span style="color: blue;font-size: 8px;"> {point.percentage:.1f}%</span>
格式:{point.name}:{point.percentage:.1f}%
                format: '<b >{point.name}</b>:<span style="color: blue;font-size: 8px;"> {point.percentage:.1f}%</span>