円グラフや棒グラフは、私は2つのコードバーグラフの円グラフ用と別のものを入れている
<html>
<head>
</head>
<body>
\t <script type="text/javascript" src="assets/js/canvasjs.min1.js"></script>
\t <script type="text/javascript">
window.onload ={
\t var chart = new CanvasJS.Chart("chartContainer",
\t {
\t \t
animationEnabled: true,
\t \t legend: {
\t \t \t verticalAlign: "bottom",
\t \t \t horizontalAlign: "center"
\t \t },
\t \t theme: "theme1",
\t \t data: [
\t \t {
\t \t \t type: "pie",
\t \t \t indexLabelFontFamily: "Garamond",
\t \t \t indexLabelFontSize: 20,
\t \t \t indexLabelFontWeight: "bold",
\t \t \t startAngle:0,
\t \t \t indexLabelFontColor: "MistyRose",
\t \t \t indexLabelLineColor: "darkgrey",
\t \t \t indexLabelPlacement: "inside",
\t \t \t toolTipContent: "{name}: {y}hrs",
\t \t \t showInLegend: true,
\t \t \t indexLabel: "#percent%",
\t \t \t dataPoints: [
\t \t \t \t { y: 52, name: "Time At Work", legendMarkerType: "triangle"},
\t \t \t \t { y: 44, name: "Time At Home", legendMarkerType: "square"},
\t \t \t \t { y: 12, name: "Time Spent Out", legendMarkerType: "circle"}
\t \t \t ]
\t \t }
\t \t ]
\t });
\t chart.render();
}
</script>
<script type="text/javascript">
\t \t window.onload = function() {
\t \t \t var chart = new CanvasJS.Chart("chartContainer2",
\t \t \t {
\t \t \t \t title:{
\t \t \t \t \t text: "Bar chart"
\t \t \t \t },
\t \t \t \t data: [
\t \t \t \t {
\t \t \t \t \t type: "bar",
\t \t \t \t \t dataPoints: [
\t \t \t \t \t { x: 10, y: 90, label:"Gulam" },
\t \t \t \t \t { x: 20, y: 70, label:"Husain" },
\t \t \t \t \t { x: 30, y: 50, label:"Shubhankar" },
\t \t \t \t \t { x: 40, y: 60, label:"Banana" },
\t \t \t \t \t { x: 50, y: 20, label:"Pineapple" },
\t \t \t \t \t { x: 60, y: 30, label:"Pears" },
\t \t \t \t \t { x: 70, y: 35, label:"Grapes" },
\t \t \t \t \t { x: 80, y: 40, label:"Lychee" },
\t \t \t \t \t { x: 90, y: 30, label:"Jackfruit" }
\t \t \t \t \t ]
\t \t \t \t }
\t \t \t \t ]
\t \t \t });
\t \t \t chart.render();
\t \t }
\t </script>
\t \t \t \t \t <!-- panel body -->
\t \t \t \t \t <div class="panel-body">
\t \t \t \t \t \t <div id="chartContainer" style="height:400px; width: 100%;"></div>
\t \t \t \t \t \t
\t \t \t \t \t </div>
\t \t \t \t \t
\t \t \t \t \t <!-- panel body -->
\t \t \t \t \t <div class="panel-body">
\t \t \t \t \t \t <div id="chartContainer2" style="height: 400px; width: 100%;"></div>
</div> \t \t \t \t \t \t
</body>
</html>
同時に表示することはできませんが、これらの二つのグラフを同時に表示することはできませんか?どうして?コードに棒グラフだけが表示されていて、円グラフが表示されていません。
... –