0

我正在使用 Google Chart 绘制 2 个图表,饼图在两个平台上都可以正常工作,但线条未Google Chrome中显示Line Chart

我不太确定这是否是由于我在绘制图表时缺少的东西,还是由于选项,或者其他我不知道的东西。如果您知道发生了什么,请提供帮助。

var data = new google.visualization.DataTable();
var data = google.visualization.arrayToDataTable([
    ['Year', 'Sales', 'Expenses'],
    ['2004',  1000,      400],
    ['2005',  1170,      460],
    ['2006',  660,       1120],
    ['2007',  1030,      540]
  ]);

var lc_maxH = document.getElementById('main-analytics-graph').style.height;
var lc_maxW = document.getElementById('main-analytics-graph').style.width;

var options = {
    width: lc_maxW,
    height: lc_maxH,
    lineWidth: 3,
    chartArea: {
        left: 50,
        top: 30,
        bottom: 30,
        width: '100%'
    },
    curveType: 'function',
    pointSize: 3,
    hAxis : {
        gridlines: {
            color: 'transparent'
        },
        textStyle: {
            color: 'white'
        },
    },
    vAxis : {
        textStyle: {
          color: 'white'
        },
        gridlines: {
            color: '#141319'
        },
        minorGridlines:{count:0},
    },
    backgroundColor: { 
        fill:'transparent'
    },
    legend: {position: 'none'}
};
var chart = new google.visualization.LineChart(document.getElementById('main-analytics-graph'));
chart.draw(data, options);

google.charts.load('current', { 'packages': ['corechart'] });
google.charts.setOnLoadCallback(drawChart);

在 Microsoft Edge 中:

微软边缘

在谷歌浏览器中:

谷歌浏览器

4

0 回答 0