This article mainly introduces the effect of 2D bar charts drawn by the jQuery plug-in FusionCharts. It analyzes the specific steps and related operating techniques of jQuery using the FusionCharts plug-in to draw 2D bar charts with a complete example. It also comes with demo source code for readers to download for reference. Friends in need can refer to it, I hope it can help everyone.
1. Design ideas
(1) Understand some characteristics and commonalities of bar charts and master their characteristics;
(2) According to the FusionCharts design hierarchy, set up the static page and data source;
(3) Introduce the bar chart and set its properties.
2. Design steps
(1) Design the script to generate the bar chart
$(function(){ var bar2D = new FusionCharts( "FusionCharts/Bar2D.swf", "myChartId", "100%", "540", "0" ); bar2D.setXMLUrl("bar2D.xml"); bar2D.render("bar2DChart"); });
(2) Design data source
<?xml version="1.0" encoding="UTF-8"?> <chart caption='(jb51.net统计)2016年动物饲养量' xAxisName='动物名称' yAxisName='饲养量' showValues='1' baseFontSize='12' baseFontColor='#A45454' dashed='1' numpLines='40' pLineColor='#0000FF' pLineThickness='1' pLineAlpha='50' pLineIsDashed='1' pLineDashLen='2' formatNumber='1' scaleRecursively='1' outCnvBaseFont='#456454' outCnvBaseFontSize='16' outCnvBaseFontColor='#00FF00' showToolTip='1' toolTipBgColor='#565677' toolTipBorderColor='#CCCCCC' showToolTipShadow='1' chartLeftMargin='5' showLabel='1'> <set label='猪' value='9856456454' /> <set label='牛' value='8754545554' /> <set label='羊' value='5784554458' /> <set label='兔' value='451545554' /> <set label='鸡' value='7989565666' /> <vLine color='FF5904' thickness='2' dashed='1' showLabelBorder='1' labelVAlign='middle' labelHAlign='center'/> <set label='鸭' value='5613265666' /> <set label='鹅' value='784545555' /> <set label='蛇' value='45412121' /> <set label='蛙' value='656521' /> <set label='鱼' value='7854656666' /> </chart>
(3) Introduce FusionCharts bar chart
<p id="bar2DChart"></p>
3. Complete example code:
FusionCharts 2D条状图 <p id="bar2DChart"></p>
4. Running rendering:
Related recommendations:
FusionCharts 3D Double Bar Chart
FusionCharts 2D Histogram Combination chart with line chart
php chart fusioncharts usage example
The above is the detailed content of Sharing the effect of 2D bar chart drawn by jQuery plug-in FusionCharts. For more information, please follow other related articles on the PHP Chinese website!