Native JavaScript pie charts, doughnut charts, and circular gradients (original work)

Add-ons
2026-07-26 04:25 4 次浏览 • 0 次下载 5.3KB
Native JavaScript pie charts, doughnut charts, and circular gradients (original work)

Last updated: 2019/7/8 4:43:42 PM

Changelog:Fixed some bugs and added several style configuration options, such as legends.


Published: 2019-07-07 23:34:45

Usage:

1
drawCircle()

Parameter list:

  • id: The ID of the element to which the chart will be rendered.

  • data: Display data

  • name: Data list name, displayed in the center label

  • value: Data value (required)

  • colors: [start, end] Gradient colors. Both values must be in RGB format.

  • radius: Doughnut chart radius. Supports number, string, or array values, such as 100, '100', '50%', [50], ['50%'], ['50%', '40%']. When using an array, the second element represents the inner circle radius. The default inner circle radius is 0.8 times the outer circle radius.

  • center: Coordinates of the doughnut chart center. Default: ['50%', '50%']. Specific numeric values are also supported, such as [100, 100].

Instance methods:

1
update()

Used to update data. The parameter is data.

星河码客

发现和分享优质开源项目,传承互联网精神,为开发者服务。

关于本站

联系我们

微信/广告合作:ITcloub (备注星河码客)

免责声明:本站资源版权归原作者所有,仅供学习与交流。如有侵权,请通过「关于我们 - 侵权投诉」联系删除。

Powered by Nuxt · Deployed on Cloudflare