# How to draw multiple curves with D3 step by step and draw curves with D3 step by step

Source: Internet
Author: User

How to draw multiple curves with D3 step by step and draw curves with D3 step by step
Bar Chart: http://bl.ocks.org/mbostock/3885304
This is the basic form of a bar chart.
Axis is a number Axis;
Tickets is the ruler on the number axis. The second tickets parameter % can display the percentage of [0, 1;
RangeRoundBands is divided by interval on [0, width], which is suitable for the column chart. rangePoints is divided by point on [0, width;
Transform is the number of transformed coordinates relative to the parent node;
The function type is executed before the load tsv file, and the program is asynchronous.

Bar Chart III: http://bl.ocks.org/mbostock/7441121
The final and simplest form of the bar chart given by tutorial.

Tick Format: http://bl.ocks.org/mbostock/9764126
In the demonstration of the number axis tickets method, it is found that after the first tickets parameter (hitting on the number axis) is passed in, the number of points (line) on the number axis is only related to the input parameter.

Log Axis: http://bl.ocks.org/mbostock/5537697
Log format. The first parameter of tickSize indicates the line length on the number axis.

Ggplot2-Style Axis: http://bl.ocks.org/mbostock/4349486
The special number axis shows different css styles for single and double numbers in line on the number axis.

Line Chart: http://bl.ocks.org/mbostock/3883245
Horizontal Axis date, vertical axis price, draw a curve.
D3.time. format, d3.time. scale two time-related objects.
The most important thing is the d3.svg. line function. You can add the d attribute to the path to draw a curve.

Multi-Series Line Chart: http://bl.ocks.org/mbostock/3884955
Horizontal Axis date, vertical axis temperature, draw temperature comparison curves of different cities.
D3.scale. category10 to distinguish different colors;
Interpolate adds some modifications to the drawn curve;
The difference between tricky and tricky is that cities are reprocessed for data, so that different curves can be drawn in batches.

Problem:
D3 examples are given to read data from tsv, and in reality we usually use ajax to read background data: http://stackoverflow.com/questions/22784164/what-is-the-best-way-to-update-d3-charts-using-ajax
How to use lines, bar charts and other ways to express Multi-Series Chart: http://www.delimited.io/blog/2014/3/3/creating-multi-series-charts-in-d3-lines-bars-area-and-streamgraphs

Resource:
Tutorial: https://github.com/mbostock/d3/wiki/Tutorials
API for search: https://github.com/mbostock/d3/wiki/API-Reference

Related Keywords:
Related Article

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.

## A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

• #### Sales Support

1 on 1 presale consultation

• #### After-Sales Support

24/7 Technical Support 6 Free Tickets per Quarter Faster Response

• Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.