【发布时间】:2017-07-25 17:01:31
【问题描述】:
我对 Highcharts 完全陌生,需要设计一个与下图完全一样的水平条形图。
我试过摆弄并设法在条形图内显示 4 和 2。但是,我无法在第一个栏上方显示“已完成”文本,在第二个栏下方显示“执行操作”文本。我也想消除酒吧之间的差距。以下是我目前的代码。
var chart = new Highcharts.Chart({
chart: {
renderTo:'container',
//marginLeft:120,
type:'bar'
},
legend: { enabled: false},
colors:['#173c64'],
xAxis: {
categories: ['4','2'],
labels: {
align:'left',
x:5,
style: {
fontSize: '4em',
color:'#fff'
}
},
lineWidth: 0,
gridLineWidth: 0,
lineColor: 'transparent',
minorTickLength: 0,
tickLength: 0,
title: {
enabled: false
}
},
yAxis: {
lineWidth: 0,
gridLineWidth: 0,
lineColor: 'transparent',
labels: {
enabled: false
},
minorTickLength: 0,
tickLength: 0,
title: {
enabled: false
}
},
title: {
margin:0,
useHTML: true,
text: "This Month",
style: {"color": "#333333", "fontSize": "1.5rem","fontWeight": "bold"}
},
series:[{
data:[{y: 20, color:'#0091dc'},{y: 17, color:'#173c64'}]
}]
});
【问题讨论】:
-
如您所知,StackOverflow 不是免费的代码编写服务。请更新您的问题,以便它在 minimal, complete, and verifiable example 中显示所有相关尝试以展示问题。
-
添加了我到目前为止的代码
标签: javascript highcharts bar-chart