Search code examples
javascriptvisualizationzingchart

How can I draw a straight line using ZingChart?


The end result should look something like this. See the LSL line? How could I draw that, is there a way to force a draw on the first value? Or should I just draw an overlay?

The end result

The attempt(inside series)

valueBox:{
    visible:true,
    color:"red",
    text:"LPL"
},
type:'line',
"line-style":"dashed",
lineWidth: 1,
"values":[max+1],
lineColor:"red",
"marker":{ visible:false}

Solution

  • You can use a minor-guide, and then set the index check to where you want it.

    "minor-guide":{
                        rules:[{
                        rule:'%scale-index === 0',
                        alpha:1,
                        lineStyle: 'dashed',
                        lineWidth:1,
                        lineColor:"red",
                        visible:true
                    }]