未捕获的TypeError:无法读取属性' precision'未定义的

时间:2014-03-29 06:40:43

标签: javascript jquery amcharts uncaught-typeerror

我使用Amcharts在柱形图中表示我的值。 这是我的代码片段:

    chart = new AmCharts.AmSerialChart();
    chart.dataProvider = chartData;
    chart.categoryField = "Title";
    chart.startDuration = 1;
    chart.valueAxes= [{
        "gridThickness":0,
    }];
    chart.categoryAxis.gridThickness= 0;
    // AXES
    // category
    var categoryAxis = chart.categoryAxis;
    categoryAxis.labelRotation = 0;
    categoryAxis.gridPosition = "start";

    // value
    var graph = new AmCharts.AmGraph();
    graph.valueField = "value";
    graph.balloonText = "[[category]]: <b>[[value]]</b>";
    graph.type = "column";
    graph.lineAlpha = 0;
    graph.fillAlphas = 0.8;
    chart.addGraph(graph);

    chart.depth3D = 15;
    chart.angle = 30;

    var chartCursor = new AmCharts.ChartCursor();
    chartCursor.cursorAlpha = 0;
    chartCursor.zoomable = false;
    chartCursor.categoryBalloonEnabled = false;
    chart.addChartCursor(chartCursor);
    chart.creditsPosition = "top-right";
    chart.write("chartdiv");

我的问题是,每当我悬停列时,都不会出现气球文字。而是在控制台中我得到如下错误:

  

未捕获的TypeError:无法读取未定义的属性'precision'   amcharts.js:21 AmCharts.formatNumber amcharts.js:21   AmCharts.formatValue amcharts.js:28   AmCharts.AmSerialChart.AmCharts.Class.formatString serial.js:25   AmCharts.ChartCursor.AmCharts.Class.updateCursor amcharts.js:178   AmCharts.ChartCursor.AmCharts.Class.setPosition amcharts.js:170   AmCharts.ChartCursor.AmCharts.Class.detectMovement amcharts.js:161   (匿名函数)

我添加了serial.jsamcharts.js。但是我仍然继续犯错,这使我无法显示气球文字。我现在该怎么办?

0 个答案:

没有答案