Edit Legend in Cloropleth maps

22 views
Skip to first unread message

DUY

unread,
May 3, 2012, 9:39:53 AM5/3/12
to prot...@googlegroups.com
Hey,

I have concerns regarding the legend's values, in the following code

/* Legend */
function legjenda() {
// Add the color bars for the color legend
vis.add(pv.Bar)
    .data(pv.range(0.00001, 1.0, 0.2))
    .bottom(function(d) this.index * 12)
    .height(10)
    .width(10)
    .left(5)
    .fillStyle(function(d) col(0.00001 + 0.2 * this.index))
    .lineWidth(null)
  .anchor("right").add(pv.Label)
    .textAlign("left")
    .text(function(d) d + " - " + (d + 0.2) + "%");
}

What I want is that instead of having to display the start interval from 0 to .2 I would rather have the value of zero displayed on it's own and have the next interval start from 0.00001 to .2 and so on.

Thanks
Reply all
Reply to author
Forward
0 new messages