在 div 中设置大小 chartjs

Set size chartjs in div

如何设置此 chartjs 的大小?所有屏幕(高度 - 宽度)

Test chart - jsfiddle.net

我试试

width:100% and height:100%

在 div canvas 中,但不起作用。

对不起我的英语不好:(

谢谢!

根据评论:

似乎对我有用。我将添加 height: 100% 被忽略,因为图表将尝试保持纵横比。因此,您可以将高度设置为 px 值以使其忽略纵横比。

样式是通过 css:

完成的
#chart {
    width: 100%;
    height: 600px;
}

http://jsfiddle.net/swtakxo0/2