- 注册时间
- 2012-7-8
- 最后登录
- 2017-11-4
- 阅读权限
- 10
- 积分
- 156
- 精华
- 0
- 帖子
- 28
|
本帖最后由 shmily4666 于 2017-8-13 11:46 编辑
代码:
YUIChart.html
<div class="mini-splitter" vertical="true" style="width:800px;height:600px;">
<div size="30" maxSize="30" >
<ul id="menu1" class="mini-menubar" style="width:100%;" url="listMenu.txt" idField="id" parentField="pid"></ul>
</div>
<div showCollapseButton="true">
<!--Tabs-->
<div class="mini-fit" style="padding-top:5px;">
<div id="mainTabs" class="mini-tabs" activeIndex="0" style="width:100%;height:100%;" bodyStyle="padding:0px;"
plain="false" >
<div title="YUIChart" url="YUIChartView.html" ></div>
</div>
</div>
</div>
</div>
YUIChartView.html
<head>
<title>jQuery MiniUI</title>
</head>
<body>
<div id="chartContainer" style="width:100%;height:100%;"></div>
</body>
</html>
<script src="YUI2/yahoo-dom-event.js" type="text/javascript"></script>
<script src="YUI2/element-min.js" type="text/javascript"></script>
<script src="YUI2/charts-min.js" type="text/javascript"></script>
<script src="YUI2/datasource-min.js" type="text/javascript"></script>
<script src="YUI2/json.js" type="text/javascript"></script>
<script src="YUI2/swf/swf-min.js" type="text/javascript"></script>
<script type="text/javascript" >
mini.parse();
var chartContainerId = "chartContainer";
buildChart();
//----------------------------------------------
function buildChart() {
YAHOO.widget.Chart.SWFURL = "YUI2/swf/charts.swf";
YAHOO.namespace("Test");
YAHOO.Test.data = [
{ month: "January", rent: 1350.00, utilities: 941.68 },
{ month: "February", rent: 1350.00, utilities: 901.35 },
{ month: "March", rent: 1350.00, utilities: 789.32 },
{ month: "April", rent: 1350.00, utilities: 684.71 },
{ month: "May", rent: 1500.00, utilities: 779.811 },
{ month: "June", rent: 1500.00, utilities: 897.95 },
{ month: "July", rent: 1500.00, utilities: 919.811 },
{ month: "August", rent: 1500.00, utilities: 937.95 },
{ month: "September", rent: 1500.00, utilities: 779.811 },
{ month: "October", rent: 1500.00, utilities: 697.95 },
{ month: "November", rent: 1500.00, utilities: 679.811 },
{ month: "December", rent: 1500.00, utilities: 897.95 }
];
var DataSource = new YAHOO.util.DataSource(YAHOO.Test.data);
DataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
DataSource.responseSchema = {
fields: ["month", "rent", "utilities"]
};
var seriesDef = [
{
displayName: "Rent",
yField: "rent",
style: { size: 10 }
},
{
displayName: "Utilities",
yField: "utilities",
style: { size: 10 }
}
];
var currencyAxis = new YAHOO.widget.NumericAxis();
var categoryAxis = new YAHOO.widget.CategoryAxis();
//chartContainerId为图表DOM元素id
var mychart = new YAHOO.widget.ColumnChart(chartContainerId, DataSource,
{
series: seriesDef,
xField: "month",
yAxis: currencyAxis,
xAxis: categoryAxis
});
}
</script>
相对来说,好似中间多一层mini-tabs控件就不行
|
|