我在chart.js中有一个折线图。
它完美地工作,除了代替传奇,我想用它代表的值标记每一行一次。
这是我的数据:
data: {
labels: ["5/8/2015", "1/15/2016", "4/22/2016"],
datasets: [{
label: "Clinton",
data: [37, 31, 36],
lineTension: 0,
fill: false,
borderColor: "blue",
backgroundColor: "blue",
}, {
label: "Trump",
data: [NaN, 16, 23],
lineTension: 0,
fill: false,
borderColor: "red",
backgroundColor: "red",
}, {
label: "Sanders",
data: [16, 27, 18],
lineTension: 0,
fill: false,
borderColor: "green",
backgroundColor: "green",
}, {
label: "Other named Republicans",
data: [41, 23, 17],
lineTension: 0,
fill: false,
borderColor: "pink",
backgroundColor: "pink",
}, {
label: "Other/None",
data: [5, 3, 6],
lineTension: 0,
fill: false,
borderColor: "grey",
backgroundColor: "grey",
}]
},
我没有看到在第五行放置文本“其他/无”的方法而没有要求用户交互(悬停)。
有什么想法吗?