Standalone Examples » Refreshing the pie chart

This shows how to refresh the pie chart dynamically.



var pie = new d3pie("pie", {
	header: {
		title: {
			text: "A Very Simple Pie"
		}
	},
	data: {
		content: [
			{ label: "JavaScript", value: 264131 },
			{ label: "Ruby", value: 218812 },
			{ label: "Java", value: 157618}
		]
	}
});

$(function() {
	$("#refreshBtn").on("click", function(e) {
		pie.redraw();
	});
});