1

I am trying to get a chart that looks like this, but with value instead of percentage:

Google Pie Chart

Google Charts would work well, but as far as I can tell the closest you can get is the above with:

legend.position = "labeled"

But you cannot change percent to value. A straight line would be better also, but not essential.

I am currently using charts.js and have tried Google charts. There is tooltip customization for charts.js, but I am not even sure how to do something quite like my example.

Does anyone have any information on how I could customize such a tooltip with charts.js or know of a good JS chart library that's easy to use and has an Angular wrapper? Both Google Charts and Charts.js are compatible with Angular, which is my preference -- though it's not 100% necessary.

4

1 回答 1

3

在谷歌图表中,如果你想使用价值而不是百分比,你可以在你的图例部分使用标签值文本:'值',如下所示:

legend : { position: 'labeled', labeledValueText: 'value', textStyle: { color: 'black', fontSize: 12, } }

See example:
https://jsfiddle.net/1pyjc5bL/1/

于 2015-07-17T17:33:29.317 回答