最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Rickshaw: Graph max y-axis is cutoff - Stack Overflow

programmeradmin4浏览0评论

I'm trying to use Rickshaw to display data in our JS app, but the y-axis is sometimes cutoff:

I have tried several variants of "display:visible", but nothing seems to work. Do you know how to fix this? (i.e. show the full "$100")?

I'm trying to use Rickshaw to display data in our JS app, but the y-axis is sometimes cutoff:

I have tried several variants of "display:visible", but nothing seems to work. Do you know how to fix this? (i.e. show the full "$100")?

Share Improve this question asked Feb 11, 2014 at 17:16 JasonJason 14k15 gold badges79 silver badges129 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 10

You can add padding to the Rickshaw.Graph object itself when creating/instantiating it:

var graph = new Rickshaw.Graph( {
  element: document.getElementById("chart"),
  renderer: 'line',
  stroke: true,
  series: seriesVar,
  padding: {top: 0.02, left: 0.02, right: 0.02, bottom: 0.02}
} );

See Rickshaw homepage for padding explanation.

发布评论

评论列表(0)

  1. 暂无评论