[英]Equal distance between points highcharts
I would like to know if there's a way to keep the distances between the points equal when using xAxis type as Datetime. 我想知道当使用xAxis类型作为Datetime时,是否有办法保持点之间的距离相等。
I want to maintain the distances equal I don't want the gap that the chart has between 3 and 6 January. 我希望保持距离相等我不希望图表在1月3日到6日间存在差距。
Highcharts.chart('container', {
xAxis: {
type: 'datetime',
ordinal: true
},
series: [{
data: [
[Date.UTC(2010, 0, 1), 29.9],
[Date.UTC(2010, 0, 2), 71.5],
[Date.UTC(2010, 0, 3), 106.4],
[Date.UTC(2010, 0, 6), 129.2],
[Date.UTC(2010, 0, 7), 144.0],
[Date.UTC(2010, 0, 8), 176.0]
]
}]
});
You can use broken axis module and set the break to 1 day and gap size to 0. If you have more breaks you can specify each break as an object in breaks array or use repeat property. 您可以使用断轴模块并将断点设置为1天,间隙大小设置为0.如果有更多断点,则可以将每个断点指定为break数组中的对象或使用repeat属性。
xAxis: {
type: 'datetime',
tickInterval: 3600 * 1000 * 24,
breaks: [{
from: Date.UTC(2010, 0, 3),
to: Date.UTC(2010, 0, 6),
breakSize: 1000 * 3600 * 24
}]
},
series: [{
gapSize: 0,
example: http://jsfiddle.net/8oL9757j/ 示例: http : //jsfiddle.net/8oL9757j/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.