Angular-nvd3(1.0.7) discreteBarChart 的条不显示

Angular-nvd3(1.0.7) discreteBarChart's bar not show up

我从示例中复制了所有选项和数据源。图表显示,但我看不到条形图。但如果我将鼠标悬停在它上面,它会给我一个工具提示。所以酒吧在那里,但我看不到它..

我用的版本是Angular-nvd3 1.0.7

和代码:

$scope.option4SkillForecast2 = {
      chart: {
        // type: 'lineChart',
        type: 'discreteBarChart',
        height: $(window).height() * 0.45,
        margin: {
          top: 20,
          right: 20,
          bottom: 50,
          left: 55
        },
        x: function (d) {
          return d.label;
        },
        y: function (d) {
          return d.value;
        },
        showValues: true,
        valueFormat: function (d) {
          return d3.format('')(d);
        },
        // color: ["red", "rgb(10,20,30)", "#935bcd", "#8b7aeb", "#8b7aeb", "#3982d2", "#a6d9fd", "#75b6d2", "#93dadc", "#65d1ae", "#61c478", "#4da338", "#76ce38", "#d9ec38", "#fbe739", "#f3af2f", "#ee7b28", "#ee7b28"],
        duration: 200,
        xAxis: {
          axisLabel: 'X Axis'
        },
        yAxis: {
          axisLabel: 'Y',
          axisLabelDistance: -10
        },
        legend: {
          margin: {
            top: 8,
            right: 50
            // bottom: 10
          }
        }
      }
    }

    $scope.data4SkillForecast = [{
      // key: "Skill Forecast",
      values: [{
          "label": "A",
          "value": 45
        },
        {
          "label": "B",
          "value": 30
        },
        {
          "label": "C",
          "value": 50
        },
        {
          "label": "D",
          "value": 70
        },
        {
          "label": "E",
          "value": 100
        },
        {
          "label": "F",
          "value": 20
        },
        {
          "label": "G",
          "value": 25
        },
        {
          "label": "H",
          "value": 30
        }
      ]
    }, ];

我不知道为什么这个栏不显示。是错误还是选项有问题?

我已经通过使用 type: multiBarChart 而不是 discreteBarChart 解决了这个问题,我不知道为什么 discreteBarChart 不起作用。谁知道请告诉我