我可以在Google Spreadsheets中完成此操作,以下是屏幕截图:
这是CSV中的小型数据集
Buy PPU,Sell PPU,Net PPU
0.023,0.019,-0.000725
0.026,0.0165,-0.003725
0.021,0.021,0.00735
0.015,0.0165,0.0147
0.021,0.028,0.0168
0.018,0.028,0.0198
任何帮助表示赞赏。我在这两种特定类型的图表的任何一个库中都没有看到一个示例(称为“阶梯”或“阶梯线”),但我相信它们足够灵活地完成此操作?
谢谢
最佳答案
似乎没有人回答这个问题,但是您可以通过在数据集配置中将 steppedLine:true 设置为chart.js来实现。
var config = {
type: 'line',
data: {
datasets: [{
label: "My dataset",
data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()],
steppedLine: true,
}
}