谷歌图表API平滑折线图 [英] Google Charts API Smooth Line Chart

查看:116
本文介绍了谷歌图表API平滑折线图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何用平滑线条而不是锯齿线创建折线图吗?



我认为我的图表对于最终用户平滑线。



以下是一个示例网址:

http://chart.apis.google.com/chart?chxr=0,0,46&chxt=y& ; CHS = 300x225的&安培; CHT = LC&安培; CHCO = 3D7930&安培; CHD = S:MNPRSYVUSSMNQRVfXXSPPM&安培; CHG = 14.3,-1,1,1&安培;的Chls = 2,4,0&安培; CHM = B,C5D4B5BB,0,0,0

我简单地使用了

  var options = {smoothLine:true,} 

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

免责声明:如果您有非常尖锐的拐角,舍入/平滑可能会引起误解(例如,如果您的曲线快速到f(x)= 0,它可以变成负值以适应角落。

Does anyone know how to create a line chart with a smooth line instead of a jagged line?

I think my chart would present much better to end users with a smooth line.

Here's an example URL:

http://chart.apis.google.com/chart?chxr=0,0,46&chxt=y&chs=300x225&cht=lc&chco=3D7930&chd=s:MNPRSYVUSSMNQRVfXXSPPM&chg=14.3,-1,1,1&chls=2,4,0&chm=B,C5D4B5BB,0,0,0

解决方案

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.

这篇关于谷歌图表API平滑折线图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆