【问题标题】:Gridster grid with dc.js and d3-tip Not working带有 dc.js 和 d3-tip 的 Gridster 网格不工作
【发布时间】:2016-06-09 02:33:44
【问题描述】:

我一直在尝试将自定义工具提示放在 dc 图表上,而我的图表容器是 gridster 网格。

D3 提示片段

var pieTip = d3.tip()
      .attr("class", "d3-tip")
      .offset([-10, 0])
      .html(function(d) {
        return "<span style='color: #f0027f'>" + d.data.key + "</span> : " + numberFormat(d.value);
      });

此片段用于渲染。

.renderlet(function(chart) {
                chart.select("svg").call(barTip)
                  .selectAll(".bar")
                  .on("mouseover", barTip.show)
                  .on("mouseout", barTip.hide);

我无法让它工作。任何指针将不胜感激。 谢谢

【问题讨论】:

    标签: d3.js dc.js gridster


    【解决方案1】:

    我找到了答案。问题是在将图表放入模态或 div 时提示的 z-index。

    【讨论】:

    • 太酷了。感谢您的回答 - 我看不出您的代码有什么问题,但请记住 z-index 是一件好事。
    • 我刚刚在模型的css中添加了一条规则 .model{ z-index:10001; }
    猜你喜欢
    • 2014-09-19
    • 1970-01-01
    • 2017-01-17
    • 2014-09-23
    • 1970-01-01
    • 2015-08-26
    • 1970-01-01
    • 1970-01-01
    • 2018-08-22
    相关资源
    最近更新 更多