var vis = new pv.Panel().canvas('grphLangSpeakers').height(langCount*(barWidth+barGap)).width(canvasWidth)
    .add(pv.Bar)
    .data(popCountArray)
    .bottom(0).width(function(d){ return d})
    .height(barWidth)
    .top(function() {return this.index * (barGap+barWidth)});

vis.render();

我在上面使用代码来生成使用Protovis条形图。如何此图表改变到对数刻度?

有帮助吗?

解决方案

您应该使用pv.Scale.log为你的函数:

http://vis.stanford.edu/protovis/ jsdoc /符号/ pv.Scale.log.html

var yScale = pv.Scale.log(0,popCountArray.length).range(0,height);

....

.top(function() yScale (this.index) );

vis.render();

希望这有助于

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top