我已生成图表格式的Google电子表格。在我的水平轴报告中,我有值:1 ,2 ,3 ,4 ,5 ,10 ,20 ,30 ,40 50 ,100 ,200 ,300 ,400 ,500 ,600 ,700 ,800 ,900 ,1000。 图表将它们解释为标签,而不是数字:
因此1到4之间的距离与20到50之间的距离相同。如何更改? (也许我必须转换输入数据 - 如何?)
带有输入数据,查询和图表的我想将其嵌入带有此类脚本的网页中:
<script type="text/javascript" src="//ajax.googleapis.com/ajax/static/modules/gviz/1.0/chart.js">
{"dataSourceUrl":"//spreadsheets.google.com/spreadsheet/tq?key=0AtdHElsKyNw9dERVZ1lZRVNmYmRqSlVVbWszd3BVdGc&transpose=0&headers=1&range=F1%3AI21&gid=0&pub=1",
"options":{
"reverseCategories":false,"titleX":"thousand objects","backgroundColor":"#FFFFFF","pointSize":0,
"width":510,
"vAxis":{"format":"#0.##########"},
"smoothLine":true,"lineWidth":2,"logScale":false,"hasLabelsColumn":true,
"hAxis":{"maxAlternation":1},
"vAxes":[{"min":null,"title":"ms","max":null,"maxValue":null}],
"title":"Performance of exposing previous value in AspectJ set-pointcut",
"height":400,"interpolateNulls":false,"legend":"bottom","reverseAxis":false
},
"state":{},
"chartType":"LineChart",
"chartName":"Performance test"
} </script>
答案 0 :(得分:7)
您可以通过在“高级设置”区域中配置垂直轴来完成此操作。
我刚刚做了,它就像一个魅力。 :)
答案 1 :(得分:4)
在Google电子表格中,我所知道的唯一图表类型是将轴理解为数字 Scatter 。
如果它不适合您(例如,因为您需要专门的线路),那么您必须处理数据。也就是说,您必须确定轴的固定步长,例如10(或您认为必要的任何其他分辨率)并根据您的数据使用某些公式填充数据列,例如相邻点之间的线性回归,或多项式插值。
我对QUERY功能不是很熟练,也许它可以帮助你自动完成。我只知道如何使用ArrayFormulas等其他“更复杂”的公式结构来实现它。
答案 2 :(得分:3)
我找到了其他解决方案。 将X轴数据的类型用作“数字”(不是字符串)和折线图
检查文档以获取详细信息: https://developers.google.com/chart/interactive/docs/customizing_axes#Discrete_vs_Continuous