title:{
display:true,
fontSize:18,
text: "Products",
titleAlign:'left'
}
但是
textalign
似乎对我和 horizontal
都不起作用
最佳答案
检查 Chart.js 文档,没有像 titleAlign 这样的选项,请参阅:https://www.chartjs.org/docs/latest/configuration/title.html .
应该是在 future ,有一个请求请求:
https://github.com/chartjs/Chart.js/pull/5866 .
有一个选项可以做到这一点,您不应该显示图表标题并添加您自己的。
这是我如何做到的例子
<div class="panel panel-default">
<div class="panel-heading">
<h5>{{ title }}</h5>
</div>
<div class="panel-body">
<canvas id="my-chart" width="150" height="150"></canvas>
</div>
</div>
关于charts - 图表js : how can I align the legend and the title,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54396656/