c3.js未显示鼠标悬停的值

时间:2016-07-02 01:11:08

标签: javascript html d3.js

我正在使用c3js.org在我的应用中显示一些图表。问题是,图表工具提示没有显示任何值。

enter image description here

  

代码

<script>
  var chart = c3.generate({
    bindto: '#designerChart',
    data: {
        x: 'Service date',
        columns: [
            ['Service date', '01-07-2016', '02-07-2016', '03-07-2016', '04-07-2016', '05-07-2016', '06-07-2016', '07-07-2016', '08-07-2016', '09-07-2016', '10-07-2016', '11-07-2016', '12-07-2016', '13-07-2016', '14-07-2016', '15-07-2016', '16-07-2016', '17-07-2016', '18-07-2016', '19-07-2016', '20-07-2016', '21-07-2016', '22-07-2016', '23-07-2016', '24-07-2016', '25-07-2016', '26-07-2016', '27-07-2016', '28-07-2016', '29-07-2016', '30-07-2016', '31-07-2016'],
            ['No. of reservations', 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
        ],
        type: 'bar',
    },
    axis: {
        x: {
            type: 'category',
            tick: {
                rotate: 75,
                multiline: false
            },
        },
    }
});
</script>

问题:如何在工具提示中显示值?

1 个答案:

答案 0 :(得分:1)

问题在于我使用patternfly.org来覆盖c3js个样式。解决方案不是包含c3js样式,而是让patternfly设置图形样式。

我删除后,一切都按预期工作。

相关问题