Jquery and highcharts line charts, column charts, and pie charts-simulate background parameter source code, jqueryhighcharts
Js Code:
<Script type = "text/javascript"> $ (function () {showLine (); showColumn (); showPie () ;}); function showPie () {jQuery. ajax ({type: "get", url: "csylLine. json ", async: false, dataType:" json ", success: function (data1) {$ ('# piechar '). highcharts ({chart: {plotBackgroundColor: null, plotBorderWidth: null, plotShadow: false, type: 'pie '}, title: {// title text: 'percentage of rainfall regions in the whole city in the chengguan district during the week'}, tooltip: {// prompt box pointFormat: '{serie S. name }:< B> {point. percentage :. 1f }%</B> '}, plotOptions: {pie: {allowPointSelect: true, cursor: 'pointer', dataLabels: {enabled: false}, showInLegend: true }}, series: [{// data column name: 'browser share ', data: data1.dataList}], credits: {// copyright information enabled: false});}, error: function (err) {alert (err) ;}}) ;}function showLine () {jQuery. ajax ({type: "get", url: "csylLine. json ", async: false, dataType:" json", Success: function (data1) {$ ('# linechart '). highcharts ({title: {text: 'line chart of temperature in one week in the chengguan area ', x:-20}, // center title xAxis: {categories: data1.xList }, // yAxis: {title: {text: 'temperature (°C) '// Y coordinate description}, plotLines: [{value: 0, width: 1, color: '#808080'}]}, tooltip: {valueSuffix: '°c '}, legend: {borderWidth: 0}, series: data1.yList, // two series are defined here, that is, two lines, the highest temperature and the lowest temperature. If there are more lines, add braces. Credits: {// copyright information enabled: false}) ;});} function showColumn () {jQuery. ajax ({type: "get", url: "csylLine. json ", async: false, dataType:" json ", success: function (data1) {$ ('# columnchart '). highcharts ({chart: {type: 'column '// column chart}, title: {text: 'Weekly rainfall forecasts in the Customs region'}, xAxis: {categories: data1.xList}, yAxis: {min: 0, title: {text: '%/mm'}, tooltip: {pointFormat:' {series. name }:< B> {point. y} </B> ', shared: true, useHTML: true}, plotOptions: {column: {pointPadding: 0.2, borderWidth: 0 }}, series: data1.zList,}) ;}}}</script>
Json format for parameter passing in the background:
{"XList": ["09-10", "09-11", "09-12", "09-13", "09-14 ", "09-15", "09-16"], // X-axis data (line, column) "yList": [{"name": "maximum daily temperature ", "data": [28, 28, 27,26, 29,32, 25] },{ "name": "The lowest daily temperature", "data, 12]}], "zList": [{"name": "rainfall probability", "data": [16.0, 20.6, 48.5, 27.4, 19.1, 15.6, 0] },{ "name": "Daily Rainfall", "data": [0.8, 0.5, 9.3, 1.0, 0.8, 0.6, 0]}], // The line chart and column chart are consistent with the "dataList": [["" ", 1], [" ", 2], [" ", 4], ["West District", 1], ["suburb", 1] // pie chart data}
There are some useful PHP icons (generating line charts, bar charts, and pie charts ).
HighCharts
JqPlot
Dygraphs
Protovis
Fusioncharts
ECharts
Google Chart Tools
JS Charts
Chart. js
JQuery Sparklines
Cubism. js
Xcharts
How does jquery's Highcharts drawing tool draw a step chart and change the line chart to a step chart?
Highcharts 3.0 is updated to add the step chart you mentioned. The specific attribute is
PlotOptions: {series: {step: 'left' // or 'center' or 'right '}}