0

我正在使用带有角度指令的 nvd3 来绘制一些数据。它曾经工作得很好,但是现在我注意到情节消失了,或者说减少到一条非常细的线。数据进来了,图正在显示,但几乎看不到。我怎样才能让它恢复正常?

这是它在 html 中的样子:

    <nvd3 options="options" data="data"></nvd3>

以下是 javascript 中的选项:

    $scope.options = {
        chart: {
            type: 'lineChart',
            height: 200,
            margin : {
                top: 20,
                right: 80,
                bottom: 40,
                left: 80
            },
            color: d3.scale.category10().range(),
            x: function(d){ return d.timestamp; },
            y: function(d){ return d.avg_voltage; },
            useInteractiveGuideline: true,
            duration: 0,
            xScale: d3.time.scale.utc(),
            xAxis: {
                axisLabel: 'Time',
                rotateLabels: 0,
                tickFormat: function (d) {return d3.time.format('%X')(new Date(d))},
                showMaxMin: false,
            },
            yAxis: {
                axisLabel: 'Voltage (v)',
                tickFormat: function(d){return d3.format('.04f')(d);}
            }
        }
    };

如果它们是问题,这里还有我所有的 javascript 依赖项:

"dependencies": {
    "angular": "^1.4.0",
    "bootstrap": "^3.3.6",
    "angular-animate": "^1.4.0",
    "angular-cookies": "^1.4.0",
    "angular-resource": "^1.4.0",
    "angular-route": "^1.4.0",
    "angular-sanitize": "^1.4.0",
    "angular-touch": "^1.4.0",
    "d3": "~3.5.8",
    "n3-line-chart": "~2.0.3",
    "angular-nvd3": "~1.0.5",
    "angular-ui-bootstrap": "~1.1.2",
    "font-awesome": "fontawesome#~4.5.0",
    "angular-bootstrap": "~1.1.2"
}

谢谢

4

0 回答 0