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)

Free Guide:

7 Habits of Successful CTOs

"What makes a great CTO?" Engineering skills? Business savvy? An innate tendency to channel a mythical creature (ahem, unicorn)? All of the above? Discover the top traits of the most successful CTOs in this free guide.

  • 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
Sponsors
Because We Like You
Free Ebooks!

Grab SitePoint's top 10 web dev and design ebooks, completely free!

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