{
type: "invertedLinear", // only linear but allow scale type registration. This allows extensions to exist solely for log scale for instance
display: true,
position: "right",
id: "y-axis-2",
ticks: {
reverse: true
},
// grid line settings
gridLines: {
drawOnChartArea: false, // only want the grid lines for one axis to show up
}
}
4条答案
按热度按时间blpfk2vs1#
chart js的Dev 2.0支持在设置轴时反转刻度的选项,这样第二个轴的声明将变为
这是https://jsfiddle.net/nwc8ys34/15/的实际应用
euoag5mw2#
使用v 2.7.0,以下内容似乎可以正常工作:
egdjgwm83#
在v3中,天平配置已更改,因此可实现所需行为,如下所示:
j8yoct9x4#
图表js 4: