您的问题更加令人怀疑,但这可能与以下问题重复
如何在同一页面上显示两个 d3.js 图表
另一种选择是使用 CanvasJS
HTML:
<div id="chartContainer1" style="height: 260px; width: 100%;"></div>
<div id="chartContainer2" style="height: 260px; width: 100%;"></div>
JavaScript:
var chart1 = new CanvasJS.Chart("chartContainer1",
{
data: [
{
type: "column",
dataPoints: [
{ x: 10, y: 71 },
{ x: 20, y: 55},
{ x: 30, y: 50 },
{ x: 40, y: 65 },
{ x: 50, y: 95 },
{ x: 60, y: 68 },
{ x: 70, y: 28 },
{ x: 80, y: 34 },
{ x: 90, y: 14}
]
}
]
});
var chart2 = new CanvasJS.Chart("chartContainer2",
{
data: [
{
type: "column",
dataPoints: [
{ x: 10, y: 21 },
{ x: 20, y: 45},
{ x: 30, y: 30 },
{ x: 40, y: 65 },
{ x: 50, y: 55 },
{ x: 60, y: 88 },
{ x: 70, y: 38 },
{ x: 80, y: 54 },
{ x: 90, y: 13}
]
}
]
});
chart1.render();
chart2.render();
JsFiddle(CanvasJS): http: //jsfiddle.net/nikdtu/x2fj6b9c/
JsFiddle(D3):http: //jsfiddle.net/nikdtu/4cyv2y0d/