Highcharts对齐绘图点以从y轴开始 [英] Highcharts align plot points to start at y-axis
问题描述
我尽力让图表从图表的绝对左侧开始(偏移,minPadding,startOnTick等)。无论我做什么,我都无法从很远的一边开始。这里是图片的例子:
下面是一个代码示例im JsFiddle,您可以在其中尝试: 以下是一些代码: b 非常感谢您的帮助! 不要使用分类的xAxis,尝试使用或线性或日期时间与labelformatter。 其中 I have tried everything I can to get the chart to start from the absolute left side of the chart (offsets, minPadding, startOnTick, etc.). No matter what I do I can't get it to start from the very far side. Here is picture examples:
Here is a code example im JsFiddle where you can try it:
http://jsfiddle.net/agrublev/VDVpu/3/ and here is some of the code: Would highly appreciate any help! Don't use categorized xAxis, try to use or linear, or datetime, with labelformatter.
Example: where 这篇关于Highcharts对齐绘图点以从y轴开始的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
http:
图表:{
类型:'区域',
高度:'175'
},
图例:false,
plotOptions:{
series:{
events:{
click:function(e){
location.href = e.point.options.url;
}
},
fillColor:{
linearGradient:[0,0,0,300],
stops:[
[0,'rgba (201,241,217,0)'],
[1,'rgba(201,241,217,1)']
]
}
}
},
title:{
text:false
},
xAxis:{
categories:['04 / 17','04 / 17','04 / 17' ,'04 / 18','04 / 19','04 / 19','04 / 20','04 / 20','04 / 21','04 / 21'],
标签: {
align:left
},tickmarkPlacement:'on',
startOnTick:true
},
yAxis:{
title:{
text:false
},
labels:{
formatter:function(){
return'$'+(this.value).formatMoney(0);
},
y:15
},
alternateGridColor:'#f4f8f9',
gridLineColor:'#c4dce2'
},
示例:
xAxis:{
labels:{
formatter:function(){
返回名称[this.value];
names
是类别数组。请参阅: http://jsfiddle.net/9tpao7Lf/ chart: {
type: 'area',
height: '175'
},
legend: false,
plotOptions: {
series: {
events: {
click: function (e) {
location.href = e.point.options.url;
}
},
fillColor: {
linearGradient: [0, 0, 0, 300],
stops: [
[0, 'rgba(201,241,217,0)'],
[1, 'rgba(201, 241, 217,1)']
]
}
}
},
title: {
text: false
},
xAxis: {
categories: ['04/17', '04/17', '04/17', '04/18', '04/19', '04/19', '04/20', '04/20', '04/21', '04/21'],
labels: {
align: "left"
},tickmarkPlacement: 'on',
startOnTick: true
},
yAxis: {
title: {
text: false
},
labels: {
formatter: function () {
return '$' + (this.value).formatMoney(0);
},
y: 15
},
alternateGridColor: '#f4f8f9',
gridLineColor: '#c4dce2'
},
xAxis: {
labels: {
formatter: function(){
return names[this.value];
}
}
}
names
is array of categories. See: http://jsfiddle.net/9tpao7Lf/