Highstocks - 使用datetime轴时,在列之间放置一条线 [英] Highstocks - Place a line between columns when using datetime axis

查看:143
本文介绍了Highstocks - 使用datetime轴时,在列之间放置一条线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用datetime轴时,是否可以在列之间放置一条线?



http://jsfiddle.net/ozke/30go12jy/4/



相关代码:

 图表:{
type:'column'
},

xAxis:{
type:'datetime',
gridLineWidth:1,gridLineColor:'#FF0000',gridZIndex:4 / *网格线样式* /
},

plotOptions:
column:{
grouping:false,
borderWidth:0,
groupPadding:0,
pointPadding:0
}
}




  • 我最初尝试做类似的操作在这里,但问题发展到一个不同的地方。

    您可以使用 plotLines code>像这样:

      plotLines:[{
    value:Date.UTC(2014, 15),
    width:1,
    color:'red',
    dashStyle:'dash',
    label:{
    text:'value',
    align:'right',
    y:20,
    x:0
    }
    },
    {
    value:Date.UTC ,17),
    width:1,
    color:'red',
    dashStyle:'dash',
    label:{
    text:'value',
    align:'right',
    y:20,
    x:0
    }
    },
    ...
    ]

    以下是 DEMO


    Is it possible to place a line between columns when using a datetime axis?

    http://jsfiddle.net/ozke/30go12jy/4/

    Relevant code:

        chart: {
            type: 'column'
        },
    
        xAxis: {
            type: 'datetime',
            gridLineWidth: 1, gridLineColor:'#FF0000', gridZIndex: 4 /* grid line styles */
        },
    
        plotOptions: {
            column: {
                grouping: false,
                borderWidth: 0,
                groupPadding: 0,
                pointPadding: 0
            }
        }  
    

    • I was originally trying to do something similar here but the question evolved a bit to much to a different place. Hence me asking again.

    解决方案

    You can use plotLines like this:

    plotLines: [{
                value: Date.UTC(2014,  1, 15),
                width: 1,
                color: 'red',
                dashStyle: 'dash',
                label: {
                    text: 'value',
                    align: 'right',
                    y: 20,
                    x: 0
                }
            },
            {
                value: Date.UTC(2014,  2, 17),
                width: 1,
                color: 'red',
                dashStyle: 'dash',
                label: {
                    text: 'value',
                    align: 'right',
                    y: 20,
                    x: 0
                }
            },
            ...
         ]
    

    Here's the DEMO

    这篇关于Highstocks - 使用datetime轴时,在列之间放置一条线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆