0

I'm charting 2 graphs using Google Chart, the pie chart works fine on both platforms, but the lines aren't displaying in Google Chrome for Line Chart.

I'm not too sure if it's due to something I'm missing when I'm drawing the chart or is it due to the options, or something else I had no clue about. Please help if you have any idea what's going on.

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);

In Microsoft Edge:

Microsoft Edge

In Google Chrome:

Google Chrome

EvT
  • 66
  • 5

0 Answers0