我想知道如何使用Highcharts框架绘制一条实线水平线。
目的:这些行的目的是我希望在某个值上有约束
额外信息:
示例:
这是我想要的一个例子,除了红线和绿线是控制线。我不希望红线和绿线有点,但要成为一条实线。
我生成上图的当前代码
Highcharts chart = new Highcharts("chart");
chart.SetXAxis(new XAxis
{
Categories = new[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }
});
chart.SetSeries(new[]{
new Series
{
Data = new Data(new object[] { 29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4 })
},
new Series
{
Data = new Data(new object[] { 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250 })
},
new Series
{
Data = new Data(new object[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 })
}
});
感谢您的帮助,如果对此问题有任何误解,请告诉我。
答案 0 :(得分:1)
你正在寻找的是名为plot-line的地方,这是它的例子
.SetYAxis(new YAxis
{
Title = new XAxisTitle { Text = "" },
PlotLines = new[]
{
new XAxisPlotLines
{
value : 0,
color : 'green',
dashStyle : 'shortdash',
width : 2,
label : {
text : ''
}
}
new XAxisPlotLines
{
value : 250,
color : 'red',
dashStyle : 'shortdash',
width : 2,
label : {
text : ''
}
}
}
})