Search code examples
javascriptd3.jsdonut-chart

Donut Chart Plugin with jQuery And D3.js need help in event


I am using donut pie chart in my project and needed to find out more events; for eg:

  1. legend,
  2. data display format,
  3. Calculating given values into chart percentage.

Found ref from here

Passing data like below:

$("#piechart").donutpie();
var chart_data = [
    {"name":"Fruits","hvalue":40.54,color:"#E33244"},
    {"name":"Veggies","hvalue":30.23,color:"#F89406"},
    {"name":"Bakery","hvalue":50,color:"#82AF6F"}
]
$("#piechart").donutpie('update', chart_data);

Below is the result

enter image description here

Any help would be appreciated, Thank you.


Solution

  • After trying many things in it, I solved it as below :

    1. set manually designed legends
    2. data display and calculation handled manually
    3. To display float value in chart, made necessary changes into main package file.