谷歌图表API平滑折线图 [英] Google Charts API Smooth Line Chart
本文介绍了谷歌图表API平滑折线图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人知道如何用平滑线条而不是锯齿线创建折线图吗?
我认为我的图表对于最终用户平滑线。
以下是一个示例网址:
解决方案
我简单地使用了
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:
解决方案
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屋!
查看全文