Highcharts 设置绘图带高度
我想降低下图中使用的绘图带的高度。是否可以使用绘图带进行此操作Highcharts 设置绘图带高度,highcharts,Highcharts,我想降低下图中使用的绘图带的高度。是否可以使用绘图带进行此操作 //------------------------------------------------------- Highcharts.Renderer.prototype.symbols.line = function(x, y, width, height) { return ['M',x ,y + width / 2,'L',x+height,y + width / 2]; }; //----------------
//-------------------------------------------------------
Highcharts.Renderer.prototype.symbols.line = function(x, y, width, height) {
return ['M',x ,y + width / 2,'L',x+height,y + width / 2];
};
//-------------------------------------------------------
Highcharts.setOptions({
chart:{
type:'bar',
margin:[5,15,10,100],
},
credits:{enabled:false},
exporting:{enabled:false},
legend:{enabled:false},
title:{text:''},
xAxis:{
tickLength:0,
lineColor:'#999',
lineWidth:1,
labels:{style:{fontWeight:'bold'}}
},
yAxis:{
min:0,
minPadding:0,
maxPadding:0,
tickColor:'#ccc',
tickWidth:1,
tickLength:3,
gridLineWidth:0,
endOnTick:true,
title:{text: ''},
labels:{
y:10,
style:{
fontSize:'8px'
},
formatter:function(){
if (this.isLast){
return this.value + ' %';
}
else{
return this.value;
}
}
}
},
tooltip:{
enabled:true,
backgroundColor:'rgba(255, 255, 255, .85)',
borderWidth:0,
shadow:true,
style:{fontSize:'10px',padding:2},
formatter:function() {
return this.series.name + ": <strong>" + Highcharts.numberFormat(this.y,2) + "</strong>";
}
},
plotOptions:{
bar:{
color:'#000',
shadow:false,
borderWidth:0,
},
scatter:{
marker:{
symbol:'line',
lineWidth:3,
radius:8,
lineColor:'#000'
}
}
}
});
//-------------------------------------------------------
var chart1 = new Highcharts.Chart({
chart:{renderTo:'container1'},
xAxis:{categories:['Title 1']},
yAxis:{
max:100,
labels:{y:10,style:{fontSize:'8px'}},
plotBands:[{from:0,to:70,color: 'rgba(103,103,103,.35)'},
{from:70,to:85,color: 'rgba(153,153,153,.35)'},
{from:85,to:100,color: 'rgba(204,204,204,.35)'}]
},
series:[{name:'Measure',pointWidth:10,data:[80]},
{name:'Target',type: 'scatter',data:[90],}]
});
//-------------------------------------------------------
var chart2 = new Highcharts.Chart({
chart:{renderTo:'container2'},
xAxis:{categories:['Title 2']},
yAxis:{
max:100,
labels:{y:10,style:{fontSize:'8px'}},
plotBands:[{from:0,to:75,color: 'rgba(103,103,103,.35)'},
{from:75,to:90,color: 'rgba(153,153,153,.35)'},
{from:90,to:100,color: 'rgba(204,204,204,.35)'}]
},
series:[{name:'Measure',pointWidth:10,data:[92]},
{name:'Target',type: 'scatter',data:[95],}]
});
//-------------------------------------------------------
var chart3 = new Highcharts.Chart({
chart:{renderTo:'container3'},
xAxis:{categories:['Title 3']},
yAxis:{
max:100,
labels:{y:10,style:{fontSize:'8px'}},
plotBands:[{from:0,to:50,color: 'rgba(103,103,103,.35)'},
{from:50,to:75,color: 'rgba(153,153,153,.35)'},
{from:75,to:100,color: 'rgba(204,204,204,.35)'}]
},
series:[{name:'Measure',pointWidth:10,data:[64]},
{name:'Target',type: 'scatter',data:[75],}]
});
//-------------------------------------------------------
var chart4 = new Highcharts.Chart({
chart:{renderTo:'container4'},
xAxis:{categories:['Title 4']},
yAxis:{
max:1000,
labels:{y:10,style:{fontSize:'8px'},formatter:function(){return this.value;}},
plotBands:[{from:0,to:600,color: 'rgba(103,103,103,.35)'},
{from:600,to:800,color: 'rgba(153,153,153,.35)'},
{from:800,to:1000,color: 'rgba(204,204,204,.35)'}]
},
series:[{name:'Measure',pointWidth:10,data:[970]},
{name:'Target',type: 'scatter',data:[850],}]
});
//-------------------------------------------------------
var chart5 = new Highcharts.Chart({
chart:{renderTo:'container5'},
xAxis:{categories:['Title 5']},
yAxis:{
max:500,tickInterval:100,
labels:{y:10,style:{fontSize:'8px'},formatter:function(){return this.value;}},
plotBands:[{from:0,to:300,color: 'rgba(103,103,103,.35)'},
{from:300,to:400,color: 'rgba(153,153,153,.35)'},
{from:400,to:500,color: 'rgba(204,204,204,.35)'}]
},
series:[{name:'Measure',pointWidth:10,data:[475]},
{name:'Target',type: 'scatter',data:[450],}]
});
//-------------------------------------------------------
//-------------------------------------------------------
Highcharts.Renderer.prototype.symbols.line=函数(x、y、宽度、高度){
返回['M',x,y+宽度/2,'L',x+高度,y+宽度/2];
};
//-------------------------------------------------------
Highcharts.setOptions({
图表:{
类型:'bar',
保证金:[5,15,10100],
},
信用证:{已启用:错误},
正在导出:{enabled:false},
图例:{enabled:false},
标题:{文本:'},
xAxis:{
长度:0,
线条颜色:'#999',
线宽:1,
标签:{style:{fontwweight:'bold'}}
},
亚克斯:{
分:0,,
数字:0,
maxPadding:0,
勾选颜色:“#ccc”,
宽度:1,
长度:3,
网格线宽:0,
恩东蒂克:是的,
标题:{文本:'},
标签:{
y:10,
风格:{
字体大小:'8px'
},
格式化程序:函数(){
if(this.isLast){
返回此值。值+'%';
}
否则{
返回此.value;
}
}
}
},
工具提示:{
启用:对,
背景颜色:“rgba(255、255、255、85)”,
边框宽度:0,
影子:没错,
样式:{fontSize:'10px',填充:2},
格式化程序:函数(){
返回this.series.name+“:”+Highcharts.numberFormat(this.y,2)+“”;
}
},
打印选项:{
酒吧:{
颜色:“#000”,
影子:错,
边框宽度:0,
},
散布:{
标记:{
符号:'行',
线宽:3,
半径:8,
线条颜色:“#000”
}
}
}
});
//-------------------------------------------------------
var chart1=新的高点图表。图表({
图表:{renderTo:'container1'},
xAxis:{categories:['Title 1']},
亚克斯:{
最高:100,
标签:{y:10,样式:{fontSize:'8px'},
绘图带:[{from:0,to:70,颜色:'rgba(103103103,.35)},
{从:70到:85,颜色:'rgba(153153,.35)},
{从:85到:100,颜色:'rgba(204204,.35)}]
},
系列:[{name:'Measure',pointWidth:10,data:[80]},
{名称:'Target',类型:'scatter',数据:[90],}]
});
//-------------------------------------------------------
var chart2=新的高点图表。图表({
图表:{renderTo:'container2'},
xAxis:{categories:['Title 2']},
亚克斯:{
最高:100,
标签:{y:10,样式:{fontSize:'8px'},
绘图带:[{from:0,to:75,颜色:'rgba(103103103,.35)},
{from:75,to:90,color:'rgba(153153,.35)},
{从:90到:100,颜色:'rgba(204204,.35)}]
},
系列:[{name:'Measure',pointWidth:10,data:[92]},
{名称:'Target',类型:'scatter',数据:[95],}]
});
//-------------------------------------------------------
var chart3=新的高点图表。图表({
图表:{renderTo:'container3'},
xAxis:{categories:['Title 3']},
亚克斯:{
最高:100,
标签:{y:10,样式:{fontSize:'8px'},
绘图带:[{from:0,to:50,颜色:'rgba(103103103,.35)},
{from:50,to:75,color:'rgba(153153,.35)},
{从:75到:100,颜色:'rgba(204204,.35)}]
},
系列:[{name:'Measure',pointWidth:10,data:[64]},
{名称:'Target',类型:'scatter',数据:[75],}]
});
//-------------------------------------------------------
var chart4=新的高点图表。图表({
图表:{renderTo:'container4'},
xAxis:{categories:['Title 4']},
亚克斯:{
最高:1000,
标签:{y:10,样式:{fontSize:'8px'},格式化程序:function(){返回此.value;}},
绘图带:[{from:0,to:600,颜色:'rgba(103103103,.35)},
{从:600到:800,颜色:'rgba(153153,.35)},
{从:800到:1000,颜色:'rgba(204204,.35)}]
},
系列:[{name:'Measure',pointWidth:10,data:[970]},
{名称:'Target',类型:'scatter',数据:[850],}]
});
//-------------------------------------------------------
var chart5=新的高点图表。图表({
图表:{renderTo:'container5'},
xAxis:{categories:['Title 5']},
亚克斯:{
最大值:500,间隔时间:100,
标签:{y:10,样式:{fontSize:'8px'},格式化程序:function(){返回此.value;}},
绘图带:[{from:0,to:300,颜色:'rgba(103103103,.35)},
{从:300到:400,颜色:'rgba(153153,.35)},
{从:400到:500,颜色:'rgba(204204,.35)}]
},
系列:[{name:'Measure',pointWidth:10,data:[475]},
{名称:'Target',类型:'scatter',数据:[450],}]
});
//-------------------------------------------------------
是的,你可以。JSFIDLE将有助于帮助uyes确保请向我提供JSFIDLE LinkedAsier使用的是和定义宽度/高度。使用多边形可能是个好主意?