所以我试图制作一个看起来像这样的高图:
但是我似乎无法将边框包裹起来。这是我能找到的最接近的地方:
有谁知道我怎么做到这一点?以下是我的选择:
highcharts({
chart: {
backgroundColor: 'transparent',
plotBorderColor: '#9E9E9E',
plotBorderWidth: 2,
height: 200,
type: 'bar'
},
title: {
text: null
},
credits: {
enabled: false
},
yAxis: {
title: {
text: null
},
labels: {
enabled: false
},
tickLength: 0,
lineColor: 0,
lineWidth: 0,
gridLineWidth: 0
},
xAxis: {
title: {
text: null
},
labels: {
enabled: false
},
tickLength: 0,
lineColor: 0,
lineWidth: 0
},
plotOptions: {
bar: {
borderColor: '#000000'
}
},
legend: {
// reversed: true,
symbolHeight: 0,
symbolWidth: 0,
floating: true,
useHTML: true,
itemDistance: 10,
y: -10,
labelFormatter:
function() {
if (this.name === "HIDDEN")
{
return '';
}
return '<div class="insp360-widgetLegendItemContainer">' +
'<div class="insp360-widgetLegendNumber" style="background-color: ' + this.color + '">' + this.yData[0] + '</div>' +
'<div class="insp360-widgetLegendName">' + this.name + '</div>' +
'</div>';
}
},
plotOptions: {
series: {
stacking: 'percent',
pointWidth: 50
}
},
series: [
{
name: 'New Business',
data: [chartData['New Business'] || 0],
color: '#ADD8E6'
},
{
name: 'Re-Underwriting',
data: [chartData['Re-Underwriting'] || 0],
color: '#FFBC57'
},
{
name: 'Consultative Visit',
data: [chartData['Consultative Visit'] || 0],
color: '#FF5200'
},
{
name: 'Recommendation Check',
data: [chartData['Recommendation Check'] || 0],
color: '#B084FF '
},
{
name: 'Other',
data: [chartData['Other'] || 0],
color: '#27AC4C'
}
];
});
答案 0 :(得分:5)
有许多事情要改变以影响这一点。
工作example
:
我更新的内容: