那是我的谷歌折线图:在此处输入图像描述 如何查看至少有 5 位小数的数字?我需要一个详细的折线图。
我也想知道如何创建更多的空白,因为我的网站的背景不能是白色的。所以现在它看起来像不美观的切割。
我的代码:
google.charts.load("44", {packages:["line"]});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data1 = new google.visualization.DataTable();
data1.addColumn('number', 'id ');
data1.addColumn('number', 'C1 ');
data1.addRows([
{% for id, qir in data1 %}
[{{ id }}, {{ qir }}],
{% endfor%}
]);
var data2 = new google.visualization.DataTable();
data2.addColumn('number', 'id ');
data2.addColumn('number', 'C2 ');
data2.addRows([
{% for id, qir in data2 %}
[{{ id }}, {{ qir }}],
{% endfor%}
]);
var data3 = new google.visualization.DataTable();
data3.addColumn('number', 'id ');
data3.addColumn('number', 'C3 ');
data3.addRows([
{% for id, qir in data3 %}
[{{ id }}, {{ qir }}],
{% endfor%}
]);
var options1 = {
width: 900,
height : 400,
axes: {
x: {
0: {side: 'down'}
}
}
};
var options2 = {
width: 600,
height : 200,
axes: {
x: {
0: {side: 'down'}
}
}
};
var joinedData = google.visualization.data.join(data1, data2, 'full', [[0, 0]], [1], [1]);
var joinedData2 = google.visualization.data.join(joinedData, data3, 'full', [[0, 0]], [1,2], [1]);
var chart1 = new google.charts.Line(document.getElementById('wykres1'));
chart1.draw(joinedData2, options1);
}
@app.route('/so')
def so():
Data1 = [(1,0.244543243223),(2,0.343454312334),(3,0.6543223411),(4,0.34231342342314),(5,0.454343343223),(6,0.5434221),(7,0.54324324314),(8,0.45324517),(9,0.543222321),(10,0.54325445519)]
Data2 = [(1,0.43654362),(2,0.46547543),(3,0.65475431),(4,0.65765454434),(5,0.6765443),(6,0.4654436),(7,0.3534657),(8,0.524343434),(9,0.453455532),(10,0.54354354358)]
Data3 = [(1,0.5345524),(2,0.6543453432),(3,0.53453465645614),(4,0.63245524),(5,0.543543536533), (6,0.53454355334),(7,0.242354531),(8,0.3424543523),(9,0.5436536544),(10,0.5425345332)]
return render_template('so.html', data1=Data1, data2=Data2, data3=Data3)