How to avoid truncated bubbles when elasticX or elasticY

泄露秘密 提交于 2019-12-10 18:45:38

问题


When you have an elastic chart and bubbles that are close to an axis (or close to the borders of the graph), the bubbles are truncated

https://github.com/dc-js/dc.js/issues/998#issuecomment-216927317


回答1:


You can add extra padding (xAxisPadding and yAxisPadding), but as the padding are on both sides of the graph, you end up loosing a lot of space and having the bubbles packed in the middle.

On workaround is to draw outside of the graph, so the bubbles are visible under the axis. To do that, remove the clipping:

  dc.bubbleChart('#bubbly') 
  .on('renderlet', function(chart, filter){
    chart.svg().select(".chart-body").attr("clip-path",null);
  })
  ...


来源:https://stackoverflow.com/questions/37042901/how-to-avoid-truncated-bubbles-when-elasticx-or-elasticy

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!