jqplot is based on a basic jqplot.js file and has plug-ins supported by multiple js files - that is to say, the jqplot.js file can only support the drawing of line charts. For pie charts, histograms and other graphics, pieRenderer needs to be introduced. .js and other files. Here we refer to the official documentation of jqPlot, taking a pie chart as an example to briefly explain the usage of jqPlot: The first step is to introduce the js file (if you are drawing other charts other than line charts, you need to introduce related js file, the pie chart file pieRenderer is introduced here)
$.jqplot('chart', [line1], { title:'pieRenderer ',//Set the title of the pie chart seriesDefaults: {fill: true, showMarker: false, shadow: false, renderer:$.jqplot.PieRenderer, rendererOptions:{ diameter: undefined, // Set the diameter of the pie padding: 20, / / The distance between the pie and its category name box or chart border, disguised as the diameter of the pie sliceMargin: 9, // The distance between each part of the pie fill:true, // Set each part of the pie Partially filled state shadow:true, //Set a shadow for the border of each part of the pie to highlight its three-dimensional effect shadowOffset: 2, //Set the shadow area to offset the border of each part of the pie distance shadowDepth: 5, // Set the depth of the shadow area shadowAlpha: 0.07 // Set the transparency of the shadow area } }, legend:{ show: true , //Set whether the category name box appears (that is, the names of all categories appear at a certain location in the picture) location: 'ne', // The location where the category name box appears, nw, n, ne, e, se, s, sw, w. xoffset: 12, // The distance between the category name box and the upper border of the chart area (unit px) yoffset: 12, // The distance between the category name box and the left border of the chart area (unit px) } });
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn