2

JSHint を使用してチェックアウトするが表示を拒否する LineChart 用の次の JavaScript があります。

// Load the LineChart charting package
google.load("visualization", "1", {
  packages: ["corechart", "line", "LineChart"]
});
// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawChart);

// Callback that creates and populates a data table,
// instantiates the line chart, passes in the data and
// draws it.
function drawChart() {
  var data = google.visualization.DataTable();
  data.addColumn('date', 'Date');
  data.addColumn('number', 'Sales');
  data.addrows([
    [new Date(2015, 2, 30), 419.5],
    [new Date(2015, 2, 31), 497.51],
    [new Date(2015, 3, 1), 1465.85],
    [new Date(2015, 3, 2), 2594.71],
    [new Date(2015, 3, 4), 2620.7],
    [new Date(2015, 3, 5), 3189.86],
    [new Date(2015, 3, 6), 4172.96],
    [new Date(2015, 3, 7), 4332.96],
    [new Date(2015, 3, 8), 4653.03],
    [new Date(2015, 3, 9), 4678.98],
    [new Date(2015, 3, 12), 5626.48],
    [new Date(2015, 3, 13), 9779.28],
    [new Date(2015, 3, 14), 10428.3],
    [new Date(2015, 3, 15), 10647.18],
    [new Date(2015, 3, 17), 10815.58],
    [new Date(2015, 3, 20), 11471.58],
    [new Date(2015, 3, 21), 11875.57],
    [new Date(2015, 3, 22), 12052.07],
    [new Date(2015, 3, 23), 13461.14],
    [new Date(2015, 3, 24), 14072.78],
    [new Date(2015, 3, 25), 14199.78],
    [new Date(2015, 3, 27), 14320.28],
    [new Date(2015, 4, 27), 100000]
  ]);
  var options = {};
  // Instantiate and draw our chart, passing in some options.
  var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
  chart.draw(data, options);
}
<script type="text/javascript" src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1.1','packages':['corechart', 'timeline','LineChart']}]}">
</script>
<div id="chart_div"></div>

それで、私は何を間違っていますか?以下を含むいくつかの日付作成方法を試みました。

    [new Date('2015-3-30'), 419.5],
4

1 に答える 1