updatd pie example to show how to use new value accessor to get the pie chart to accept the previous data format

master-patched
Bob Monteverde 12 years ago
parent 09a55af5f5
commit 60ca9d6b2d

@ -127,9 +127,10 @@ nv.addGraph(function() {
height = 500;
var chart = nv.models.pieChart()
.x(function(d) { return d.label })
.y(function(d) { return d.value })
.labelThreshold(.08)
.x(function(d) { return d.key })
//.y(function(d) { return d.value })
.values(function(d) { return d })
//.labelThreshold(.08)
//.showLabels(false)
.color(d3.scale.category10().range())
.width(width)
@ -137,8 +138,8 @@ nv.addGraph(function() {
.donut(true);
d3.select("#test2")
.datum(historicalBarChart)
//.datum(testdata)
//.datum(historicalBarChart)
.datum([testdata])
.transition().duration(1200)
.attr('width', width)
.attr('height', height)

Loading…
Cancel
Save