Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

3D Pie chart in Highcharts/Javascript

I need to draw 3d pie chart in javascript. It should look like below :- 3d Pie chart

There are various example present in the Google charts, amcharts and jscharts for 3d pie Graphs but none looks like the below image.

Links :- http://www.amcharts.com/demos/3d-pie-chart/

In PHP I found one solution here http://www.advsofteng.com/doc/cdphpdoc/multidepthpie.htm but I want something interactive with tooltips support.

Please suggest any javascript library for this. I love to use highcharts but it do not support even simple 3d Pie charts.

Thanks,

like image 772
techgyani Avatar asked Jul 04 '26 01:07

techgyani


2 Answers

Well, we are right now working on 3D charts, see:

  • scatter chart
  • pie
  • another pie
  • half-pie
  • column chart
  • another column chart

Edit: It's already released with Highcharts 4.x version, see samples.

like image 144
Paweł Fus Avatar answered Jul 05 '26 15:07

Paweł Fus


It's the top most requested feature in Highcharts.

http://highcharts.uservoice.com/forums/55896-general and it looks like we have to wait some time!

Does it support 3D pie chart?

But using Google visualization API you can achieve this very easily. enter image description here

code

   <html>
  <head>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ['Task', 'Hours per Day'],
          ['Work',     11],
          ['Eat',      2],
          ['Commute',  2],
          ['Watch TV', 2],
          ['Sleep',    7]
        ]);

        var options = {
          title: 'My Daily Activities',
          is3D: true,
        };

        var chart = new google.visualization.PieChart(document.getElementById('piechart_3d'));
        chart.draw(data, options);
      }
    </script>
  </head>
  <body>
    <div id="piechart_3d" style="width: 900px; height: 500px;"></div>
  </body>
</html>

See documentation for more features https://developers.google.com/chart/interactive/docs/gallery/piechart

Hope I helped you :)

like image 22
Amila Iddamalgoda Avatar answered Jul 05 '26 15:07

Amila Iddamalgoda



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!