0

我使用谷歌图表折线图,它在标签 5 处跳过了一条网格线,见下文: 在此处输入图像描述

我的代码:

function drawChart() {

            var dataTable = new google.visualization.DataTable();
            dataTable.addColumn('number', 'date');
            dataTable.addColumn('number', 'base');
            dataTable.addColumn('number', 'sale');
            dataTable.addRows([
            [1, 2, 2],
            [2, 2, 3],
            [3, 2, 3],
            [4, 2, 4],
            [5, 2, 5],
            [6, 2, 3],
            [7, 2, 5]
        ]);

            var options = {
                enableInteractivity: true,
                pointSize: 10,
                legend: 'none',
                chartArea:{width:'90%',height:'55%'},
                series: { 0: { color: '#a3d06e', pointSize: 1, lineWidth: 4 }, 1: { color: '#717171'}},
                hAxis: {ticks: [{v:0, f:""},{v:1, f:"lable 1"}, {v:2, f:"lable 2"}, {v:3, f:"lable 3"}, {v:4, f:"lable 4"}, 
                                {v:5, f:"lable 5"}, {v:6, f:"lable 6"}, {v:7, f:"lable 7"}, {v:8, f:""}],
                        gridlines: {count: 9}, showTextEvery: 1}

            };

            var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
            chart.draw(dataTable, options);

我能做些什么?

4

0 回答 0