>  기사  >  백엔드 개발  >  FusionCharts 3D 듀얼 막대 차트

FusionCharts 3D 듀얼 막대 차트

黄舟
黄舟원래의
2017-02-15 15:22:432077검색

1. 3D 이중 컬럼 차트 페이지의 소스코드는 다음과 같습니다

doubleColumn3D.html:

<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>FusionCharts 3D双柱状图</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width">
        <script type="text/javascript" src="../script/jquery-1.10.2.js"></script>
        <script type="text/javascript" src="../script/Charts/FusionCharts.js"></script>
        <style type="text/css">
            body{
                width:99%;
                height:100%;
                font-size:12px;
            }
            #doubleColumn3DChart{
                width:100%;
            }
        </style>
        <script type="text/javascript">
            $(function(){
                var column3D = new FusionCharts( "../script/Charts/MSColumn3D.swf", "myChartId", "100%", "520", "0" );
                column3D.setXMLUrl("data/doubleColumn3D.xml");
                column3D.render("doubleColumn3DChart");   
            });
        </script>
    </head>
    <body>
        <p id="doubleColumn3DChart"></p>
    </body>
</html>

2. 3D 이중 컬럼 차트 데이터 소스


doubleColumn3D.xml:

<?xml version="1.0" encoding="UTF-8"?>
<chart caption=&#39;2012年和2013年统计收入&#39; xAxisName=&#39;月份&#39; yAxisName=&#39;收入&#39; showValues=&#39;0&#39; baseFont=&#39;微软雅黑&#39; baseFontSize=&#39;14&#39;
       baseFontColor=&#39;#00FF00&#39; outCnvBaseFont=&#39;宋体&#39; outCnvBaseFontSize=&#39;16&#39; outCnvBaseFontColor=&#39;#798777&#39; showAboutMenuItem=&#39;1&#39;
       showLabels=&#39;1&#39; labelDisplay=&#39;ROTATE &#39; useEllipsesWhenOverflow=&#39;1&#39; rotateLabels=&#39;1&#39; slantLabels=&#39;1&#39; staggerLines=&#39;2&#39;
       labelStep=&#39;3&#39; placeValuesInside=&#39;1&#39; showYAxisValues=&#39;1&#39; showLimits=&#39;1&#39; showpLineValues=&#39;1&#39; showShadow=&#39;1&#39; adjustp=&#39;1&#39;
       setAdaptiveYMin=&#39;1&#39; centerYaxisName=&#39;1&#39; useRoundEdges=&#39;1&#39; numpLines=&#39;8&#39; pLineColor=&#39;#987989&#39; pLineIsDashed=&#39;1&#39;>

   <categories>
      <category label=&#39;一月&#39; />
      <category label=&#39;二月&#39; />
      <category label=&#39;三月&#39; />
      <category label=&#39;四月&#39; />
      <category label=&#39;五月&#39; />
      <category label=&#39;六月&#39; />
      <category label=&#39;七月&#39; />
      <category label=&#39;八月&#39; />
      <category label=&#39;九月&#39; />
      <category label=&#39;十月&#39; />
      <category label=&#39;十一月&#39; />
      <category label=&#39;十二月&#39; />
   </categories>

   <dataset seriesName=&#39;2012&#39;>
      <set value=&#39;45155&#39; />
      <set value=&#39;12452&#39;/>
      <set value=&#39;63455&#39; />
      <set value=&#39;45233&#39; />
      <set value=&#39;95656&#39; />
      <set value=&#39;87545&#39; />
      <set value=&#39;12425&#39; />
      <set value=&#39;94633&#39; />
      <set value=&#39;85452&#39; />
      <set value=&#39;75455&#39; />
      <set value=&#39;32312&#39; />
      <set value=&#39;65625&#39; />
   </dataset>

   <dataset seriesName=&#39;2013&#39;>
      <set value=&#39;65655&#39;/>
      <set value=&#39;74555&#39;/>
      <set value=&#39;61245&#39;/>
      <set value=&#39;12451&#39;/>
      <set value=&#39;95656&#39; />
      <set value=&#39;24655&#39; />
      <set value=&#39;45122&#39; />
      <set value=&#39;32656&#39; />
      <set value=&#39;65656&#39; />
      <set value=&#39;95666&#39; />
      <set value=&#39;65323&#39; />
      <set value=&#39;54656&#39; />
   </dataset>

</chart>

3. 실행 결과는 아래와 같습니다


(1) 초기화 중



(2) 범례 클릭 시 2012


(3) 범례 클릭 시 2013


(4) 범례 2012, 범례 2013
클릭 시


위 내용은 FusionCharts 3D 이중막대차트 관련 내용을 더 보시려면 PHP Chinese Net(www.php.cn)을 주목해주세요!

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.