Echarts Circular pie chart dynamically get JSON dataAs follows:I. HTML sectionTwo. js sectionThree. The JSON format is as follows:{"List": [{"Department": "Heping", "num": 480},{"department": "Hexi District", "num": 380},{"department": "Hedong", "num": 366},{" Department ":" Hebei District "," num ": 320},{" department ":" Nankai District "," num ": 300}]} Echart
Before writing a demo There are some things to use D3 to achieve some effects but in many forums to find resources can not find the way to use the d3.js in Vue, npm above the D3 relatively speaking is very impersonal no say on webpack how to use D3.jsFinally, a long time to
In the CRM system, children's shoes should be more or less exposed to hicharts or echarts and other data statistics plug-ins. Using these two, the personal feeling of echarts better look. As for the function, only the best for their own.Today I'm going to talk about my experience using Echarts's pie chart.Let's take a look at it briefly: (when the mouse moves to 1.0)Using Echarts, you can go to the official website http://echarts.baidu.com/Download th
The scale is a very important concept in D3. It is not a good way to use the size of a numeric value to represent pixels directly when drawing a drawing, and this chapter is about solving this problem.first, why need scaleThe previous chapter produced a column chart with an array that, when plotted, directly assigns a value of 250 to the width of the rectangle, that is, the width of the rectangle is 250 pix
) {return width-padding.right*0.8;}). attr ("Y", function (d,i) {return padding.top * 2 + labheight * i;}). attr ("dy", LABRADIUS/2). Text (function (d) {return d.name;});Use circles and text as labels to add to the right side of the chart. As shown in final result 4.Figure 4Full code Please click the following URL, and then right click to view the source code:Http://www.ourd3js.com/demo/G-3.0/stack.htmlThank you for reading.Document Information
What is a Sankey diagram?
Draw a simple Sankey diagram with D3
Add text
Circular node
Add an interaction effect
Note: This article without the author's permission is forbidden reprint and deduction
1 What is a Sankey diagram?
Sankey diagram is 流图 flow diagram a kind of (), used to describe the flow of energy, population, economy and so on. First proposed by the Irish Matthew Henry Phineas Riall Sankey. Sank
data to the DOM and output, the number of elements of the array and the number of P-nodes consistent with all the updated text, if not consistent, only update the existing P-node text, the extra data will be saved, see below will be used. SelectAll ("P"). data ([4, 8, 15, 16, 23, 42]). text (function (d) {return D;});Enter ... CommonP.enter (). Append ("P")//if inconsistent, the number of array elements is more than the P node, insert p node to complement and update the text accordingly. text (
to troubleshoot garbled files when reading a CSV file
2.0
Mechanics diagram + people relationship diagram
2.1
The event of a mechanics diagram + the fixation of vertices
2.2
Parameters of the Mechanics diagram
3.0
Partition map
3.1
Circular zoning Diagram
3.2
function of the partition graph
4.0
Draw arrows
5.0
Histogram
6.
When plotting lines and curves in the SVG drawing area, it is often necessary to add arrows somewhere. This article describes how to add arrows to lines and curves in D3.
So far, the chart we have drawn D3 is in the SVG plot area, although D3 can also be plotted with Canvas or WebGL, but SVG is the most common. So, us
value3. Use of Update and ExitWhen the corresponding element is too large (the number of bound data Now there are three P elements in the body, to bind an array of length less than 3 to the selection set of p, and then handle both the update and exit respectively.varDataSet = [3 ]; //Select the P element in bodyvarp = D3.Select("Body"). SelectAll ("P"); //Get the Update sectionvarUpdate =p.data (dataset);//Get exit SectionvarExit =update.exit ();//ha
":", "Value": 3}, {"Source":, "target": 17 , "Value": 3}, {"source": "Target": 3}, {"source": "Target":, "Value": 3}, {"source": "Target": 2 0, "Value": 5}]}
The data consists of two parts, dots (nodes) and edges (links), and the values of source and target represent the elements corresponding to the numeric subscript of the nodes array.
Note that, regardless of the number of attributes of the nodes element, source and target temporarily point to a person's name, such as Source 1 target0 repr
a car company now, and the monthly car sales are represented by a column chart, assuming 100 sales this month, with 100-pixel-length columns. Next month 500 sales, in 500 pixels, and next month there are 3000 units? It is impossible to use 3,000 pixels and the browser length is not enough. The scale is used at this time.In scale, given a domain (defined field), a range is given, and the conversion between the values is possible.The most commonly used
d.target.x;}); Edges_line.attr ("Y2", function (d) {return d.target.y;}); Update the position of text on the connector edges_text.attr ("X", function (d) {return (d.source.x + d.target.x)/2;}); Edges_text.attr ("Y", function (d) {return (d.source.y + d.target.y)/2;}); Whether to draw the text on the connector Edges_text.style ("Fill-opacity", function (d) {return D.source.show | | d.target.show 1:0.0;}); Update the node image and text nodes_img.attr ("X", function (d) {return D.X-IMG_W/2;});
= 20;var Nodes_text = Svg.selectall (". Nodetext"). Data (Root.nodes). Enter ( ). Append ("text"). attr ("Class", "Nodetext"). attr ("DX", TEXT_DX). attr ("dy", Text_dy). Text (function (d) {return d.name;});第1-16 Line: Drawing a picture第10-15: Displays the text on the connector you want to associate with this node when you move the mouse over the picture. This is just a Boolean assignment for D.show, which is used later in the update.第21-30: Draw text below the picture4.5 UpdateTo keep the mec
as: Venn diagram, heat map, evolutionary tree, two-dimensional scatter plot, two-dimensional scatter bubble, three-dimensional scatter plots, etc. Believe you should be able to find what you need in this list.1. Flotr2FLOTR2 is an independent framework library that supports HTML5 charts and graphs. It is a branched version of FLOTR, removing Prototype dependencies, and there are many improvements. Support: Line chart, bar
as: Venn diagram, heat map, evolutionary tree, two-dimensional scatter plot, two-dimensional scatter bubble, three-dimensional scatter plots, etc. Believe you should be able to find what you need in this list.1. Flotr2FLOTR2 is an independent framework library that supports HTML5 charts and graphs. It is a branched version of FLOTR, removing Prototype dependencies, and there are many improvements. Support: Line chart, bar
", estimated to have 5 videos around, the length is moderate, explain D3 the most basic knowledge, so that beginners quickly get started. (⊙o⊙)A total of 12 articles in the Advanced series are listed below.
1.0
Line wrapping of text
1.1
Wrap Text Wrapping
2.0
Bundle diagram
3.0
Stack diagram
4.0
Matrix Tree Chart
Let's take a look at the effect chart.
Directly below the source code, HTML file
Linechart.js is responsible for loading and refreshing the line chart
function Loadlinechart (ElementID, DataSet) {var svg = D3.select ("#" + ElementID);
var STRs = svg.attr ("Viewbox"). Split ("");
alert (dataset);
var width = strs[2];
var height = strs[3
By using d3 and js to visualize data, data can be separated from code to facilitate data modification in the future.
This time, a five-dimensional Radar chart is drawn using d3.js, which compares the five attributes of multiple objects on one map.
Data is written into data
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.