如何使用HighStocks或HighCharts在图表中添加垂直线? [英] How to add vertical lines to graph with HighStocks or HighCharts?

查看:64
本文介绍了如何使用HighStocks或HighCharts在图表中添加垂直线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用HighChart的HighStock成功创建了一个图表.我正在尝试向图表添加垂直线.我已经在HighStock的文档,Stackoverflow和Google中到处搜索了有关如何执行此操作的方法,但是都没有用.我尝试了HighStock的标志",但无法使用它们创建垂直线.

I have successfully created a chart with HighChart's HighStock. I'm trying to add vertical lines to the chart. I've searched everywhere in HighStock's docs, Stackoverflow and Google on how to do this, but to no avail. I tried HighStock's "flags" but can't create vertical lines with them.

我基本上想翻一下这张图...

I basically want to turn this chart...

...变成这样:

这甚至有可能吗?如果是,怎么办?谢谢!

Is this even possible? If yes, how? Thanks!

推荐答案

是的,这些被称为 plotLines ,并且很容易添加,例如:

Yes, These are called plotLines and are easily added like:

xAxis: {
    plotLines: [{
        value: Date.UTC(2015, 3, 15),
        width: 1,
        color: 'green',
        dashStyle: 'dash',
        label: {
            text: 'Latest value',
            align: 'right',
            y: 12,
            x: 0
        }
    }]
},

这篇关于如何使用HighStocks或HighCharts在图表中添加垂直线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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