Google Charts API Smooth Line Chart

感情迁移 提交于 2019-12-05 04:22:28

I simply used

var options = {smoothLine: true,}

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

Disclaimer: if you have very sharp corners the rounding/smoothing can be misleading (for ex. if your curve goes quickly to f(x) = 0 it can become negative to fit the corner.

From Google Chart API docs:

You can smooth the lines by setting the curveType option to function

In code:

var options = {
      title: 'Company Performance',
      curveType: 'function',
      legend: { position: 'bottom' }
    };
veetrag

If you are using a line graph, you can always use curveType: 'function' in your series options and that will make the "series" smooth.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!