2016-07-07 302 views

回答

1

我发现了一个在Chart.js GitHub root page称为Chart.Annotations.js插件。这是正是我需要的!

您需要将以下属性添加到你的选择对象添加一个注释:每行属性,你想画在我来说,我有2

annotation: { 
annotations: [{ 
    type:'line', 
    mode:'horizontal', 
    scaleID:'y-axis-1', 
    value:'10', 
    borderColor:'#000000', 
    borderWidth:2 
}] 
} 

看看这张截图我最终实现的: enter image description here