0
votes

I copied all options and datasource from example . and the graph shows , but I can't see the bars . but if I mouse over it , it gave me a tooltips. so the bar is there , but I can't see it..

the version I used was Angular-nvd3 1.0.7

enter image description here

and the code :

$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
        }
      ]
    }, ];

I don't know why the bar not show up .It's a bug or there something wrong with the option?

1

1 Answers

0
votes

I have fixed this by using type: multiBarChart instead of discreteBarChart , I don't know why discreteBarChart doesn't work . if any one knows , please tell me.