如何使用chartjs绘制虚线? [英] How can I draw dotted line using chartjs?

查看:238
本文介绍了如何使用chartjs绘制虚线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用chartjs绘制虚线。在创建虚线时没有看到任何选项。我觉得我们需要扩展chartjs以支持这一点。

I would like to draw dotted line using chartjs. I did not see any options in creating dotted lines. I feel we need to extend the chartjs to support this. Can some one help me in this?

推荐答案

Chart.js 2.1 + ,在数据集中使用 borderDash 选项。它需要两个数字组成的数组。 查看此代码笔

In Chart.js 2.1+, use the borderDash option within your dataset. It takes an array of two numbers. See this codepen

这篇关于如何使用chartjs绘制虚线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆