0
我剛剛發現了xCharts,並試圖從官方頁面的文檔中自己學習。我已經將下面的代碼應用於基本演出,所以稍後我可以使用這些圖表,但是圖表並未顯示在圖中。有任何想法嗎?謝謝。JavaScript - xCharts的基本實現
我的代碼:
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<figure style="width: 300px; height: 300px" id="myChart"></figure>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="js/d3.js"></script>
<script src="js/xcharts.css"></script>
<script src="js/xcharts.js">
var data = {
"xScale": "ordinal",
"yScale": "linear",
"type": "bar",
"main": [
{
"className": ".pizza",
"data": [
{
"x": "Pepperoni",
"y": 12
},
{
"x": "Cheese",
"y": 8
}
]
}
],
"comp": [
{
"className": ".pizza",
"type": "line-dotted",
"data": [
{
"x": "Pepperoni",
"y": 10
},
{
"x": "Cheese",
"y": 4
}
]
}
]
};
var myChart = new xChart('bar',datai,'#myChart');
</script>
<?php
// put your code here
?>
</body> </html>