JavaScript
Article

Create a quick pie chart with jQuery

By Sam Deering

Quick jQuery snippet to create a pie chart using the sparklines js plugin. Quick and easy.

$.getScript('js/jquery.sparkline.min.js', function()
{
    $('#sparklinesExample').html('1,2,3');
    $('#sparklinesExample').sparkline('html', { type: 'pie', height: '9.0em' });
});

slice

Demo: http://www.jquery4u.com/function-demos/slice/
Download Demo: slice-demo.zip (7kb)

  • Manikandan Sethuraju

    Hi..
    This one is great, and its very useful to me..
    can we able to change this chart to 3D format?
    We can means, please replay to my mailid – mani.vibrant@gmail.com

    Advance Thanks,

    Manikandan Sethuraju

    • jquery4u

      Hi Manikandan Sethuraju, unfortunately it cannot do 3D.

Recommended

Learn Coding Online
Learn Web Development

Start learning web development and design for free with SitePoint Premium!

Get the latest in JavaScript, once a week, for free.