highcharts 固定距离的日期时间点
highcharts datetime point at fixed distance
抱歉,如果我的问题已经得到解答。
这是一个 Highcharts 示例:JsFiddle
如您所见,xaxys 是按比例缩放的...有没有办法让所有列居中,并且彼此之间的距离相同,而不管日期时间如何?
var categoriesGrafico = [1417388400000, 1418511600000, 1418598000000, 1419894000000 ];
var seriesGrafico = [
{
"name": "605392037434",
"data": [
{
"name": "D140088572",
"x": 1417388400000,
"y": 55.21
},
{
"name": "D140088572",
"x": 1418511600000,
"y": 55.21
},
{
"name": "D140088572",
"x": 1418598000000,
"y": 55.21
},
{
"name": "D140088572",
"x": 1419894000000,
"y": 55.21
}
],
"_colorIndex": 0
}
];
$(function () {
$('#container').highcharts({
chart: {
type: 'column'
},title: {
text: 'title'
},plotOptions: {
column: {
stacking: 'normal',
minPointLength: 2
}
},xAxis: {
type: 'datetime',
title: {
text: 'date'
},
tickPositions: categoriesGrafico,
labels:{
rotation: -90,
formatter:function(){
return Highcharts.dateFormat('%d/%m/%Y',this.value);
}
},
reversed: true,
dateTimeLabelFormats: {
day: '%d/%m/%Y',
}
},yAxis: {
title: {
text: 'value'
},
min: 0
},
series: seriesGrafico
});
});
一种类别或线性图...
提前致谢。
您可以在 xAxis
中使用 HighStock 的 ordinal
值。但是,如果您没有为 HighStock 付费而只为 HighCharts 付费,这可能意味着您必须获得额外的许可 - refer here
HighStock API and example
中的序号参数
抱歉,如果我的问题已经得到解答。
这是一个 Highcharts 示例:JsFiddle
如您所见,xaxys 是按比例缩放的...有没有办法让所有列居中,并且彼此之间的距离相同,而不管日期时间如何?
var categoriesGrafico = [1417388400000, 1418511600000, 1418598000000, 1419894000000 ];
var seriesGrafico = [
{
"name": "605392037434",
"data": [
{
"name": "D140088572",
"x": 1417388400000,
"y": 55.21
},
{
"name": "D140088572",
"x": 1418511600000,
"y": 55.21
},
{
"name": "D140088572",
"x": 1418598000000,
"y": 55.21
},
{
"name": "D140088572",
"x": 1419894000000,
"y": 55.21
}
],
"_colorIndex": 0
}
];
$(function () {
$('#container').highcharts({
chart: {
type: 'column'
},title: {
text: 'title'
},plotOptions: {
column: {
stacking: 'normal',
minPointLength: 2
}
},xAxis: {
type: 'datetime',
title: {
text: 'date'
},
tickPositions: categoriesGrafico,
labels:{
rotation: -90,
formatter:function(){
return Highcharts.dateFormat('%d/%m/%Y',this.value);
}
},
reversed: true,
dateTimeLabelFormats: {
day: '%d/%m/%Y',
}
},yAxis: {
title: {
text: 'value'
},
min: 0
},
series: seriesGrafico
});
});
一种类别或线性图...
提前致谢。
您可以在 xAxis
中使用 HighStock 的 ordinal
值。但是,如果您没有为 HighStock 付费而只为 HighCharts 付费,这可能意味着您必须获得额外的许可 - refer here
HighStock API and example
中的序号参数