如何避免截断气泡时弹性X或弹性Y [英] How to avoid truncated bubbles when elasticX or elasticY

查看:132
本文介绍了如何避免截断气泡时弹性X或弹性Y的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当弹性图表和气泡靠近轴(或靠近图表边界)时,气泡会被截断

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

推荐答案

您可以添加额外的填充(xAxisPadding和yAxisPadding)在图的两侧,你最终会失去很多空间,并且气泡包含在中间。

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);
  })
  ...

这篇关于如何避免截断气泡时弹性X或弹性Y的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆