Echarts-Quick Start

Source: Internet
Author: User

<! Doctype HTML>
<Head>
<Meta charset = "gb2312">
<Title> echarts </title>
</Head>
<Body>
<! -- Reference the echarts file -->
<SCRIPT src = "echarts-plain.js" data-Ke-src = "echarts-plain.js"> </SCRIPT>
<! -- Prepare a Dom with the size (width and height) for echarts -->
<Div id = "Main" style = "height: 400px"> </div>
<SCRIPT type = "text/JavaScript">
Function MYD (){
// Initialize the echarts Chart Based on the prepared dom
VaR MyChart = echarts. INIT (document. getelementbyid ('main '));

VaR option = {
Title :{
Text: 'user access source of a website ',
Subtext: 'purely fictitious ',
X: 'center'
},
Tooltip :{
Trigger: 'item ',
Formatter: "{A} <br/> {B }:{ c} ({d} % )"
},
Legend :{
Orient: 'signature ',
X: 'left ',
Data: ['direct access', 'email marketing ', 'Alliance ads', 'video ads', 'search engine']
},
Toolbox :{
Show: True,
Feature :{
MARK: {Show: true },
Dataview: {Show: True, readonly: false },
Restore: {Show: true },
Saveasimage: {Show: true}
}
},
Calculable: True,
Series :[
{
Name: 'Access source ',
Type: 'pie ',
RADIUS: '123 ',
Center: ['20160301', '20160301'],
Data :[
{Value: 335, name: 'direct access '},
{Value: 310, name: 'directmail '},
{Value: 234, name: 'Alliance ads '},
{Value: 135, name: 'video ads '},
{Value: 1548, name: 'searchengine '}
]
}
]
};


// Load data for the echarts object
MyChart. setoption (option );
}

</SCRIPT>
<A href = "javascript: MYD ()"> dddd </a>
</Body>

This article from the "Su Yan" blog, please be sure to keep this source http://suyanzhu.blog.51cto.com/8050189/1562157

Echarts-Quick Start

Contact Us

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.