圖表控制元件anyChart和FusionCharts的flash透明
阿新 • • 發佈:2019-01-06
【anyChart】:(以某折線圖為例)
chart.wMode = "transparent";
bgAlpha=“0” 背景透明度
chart.wMode = "transparent";
例子:
<script>
var chart = new AnyChart('js/anyChart-6.2.0/swf/AnyChart.swf?rid='+ new Date().getTime(), 'js/anyChart-6.2.0/swf/Preloader.swf');
chart.width = "90%";
chart.height = "60%";
chart.wMode = "transparent";
//dataPath='data_bak/21_ad.xml';
chart.setXMLFile(dataPath);
chart.write(elementID);
</script>
【FusionCharts】:(以中國地圖為例)
chart.setTransparent(true);
例子:
<script>
var chart = new FusionCharts("js/FUSIONCHARTS.COM/FusionMapsXT/Maps/FCMap_China2.swf?r=" + new Date().getTime() , "ChartId"+ new Date().getTime() , "100%","100%");
chart.setDataURL(dataPath);
chart.setTransparent(true);
//chart.updateChartURL(dataPath);
chart.render(elementID);
</script>
注意,相應的xml檔案要設
canvasBgAlpha=“0” 3d背景透明度bgAlpha=“0” 背景透明度