質問

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