]> git.ipfire.org Git - thirdparty/Chart.js.git/commit
New weight option for pie and doughnut charts (#5951)
authorVincent-Ip <40588938+Vincent-Ip@users.noreply.github.com>
Wed, 27 Feb 2019 22:06:54 +0000 (17:06 -0500)
committerSimon Brunel <simonbrunel@users.noreply.github.com>
Wed, 27 Feb 2019 22:06:54 +0000 (23:06 +0100)
commit93f4e6e4e8431fdfbdec8654ec325ab9b51cb501
tree9e25be35ed9fdaf6626d7ace8b8c16c5d0e0ce46
parent79fc340514cb3d52334adefd5c10175386104605
New weight option for pie and doughnut charts (#5951)

Add functionality to give pie & doughnut datasets a weight attribute, which affects the relative thickness of the dataset when there are multiple datasets in pie & doughnut charts. The default weight of each dataset is 1, providing any other numerical value will allow the pie or doughnut dataset to be drawn with a thickness relative to its default size.

For example a weight of 2 will allow the dataset to be drawn double its typical dataset thickness. Note that the weight attribute will only affect a pie or doughnut chart if there is more than one visible dataset. Using weight on a pie or doughnut dataset when there is only one dataset on the chart will have no affect.
docs/charts/doughnut.md
src/controllers/controller.doughnut.js
test/fixtures/controller.doughnut/doughnut-weight.json [new file with mode: 0644]
test/fixtures/controller.doughnut/doughnut-weight.png [new file with mode: 0644]
test/fixtures/controller.doughnut/pie-weight.json [new file with mode: 0644]
test/fixtures/controller.doughnut/pie-weight.png [new file with mode: 0644]