Simple use of Highcharts

Source: Internet
Author: User

In the use of the chart JS plug-in, the individual think or highcharts the best, regardless of compatibility, rendering speed, or even the document in detail, have always felt highcharts better. Now take the time to do a simple summary, such as starting with a rectangular chart:

1, introduced JS
<script src= "Http://" >

2, configuring properties, rendering Charts
<DivID= "Topfiveusers"class= "Top-ten-users">        <Divclass= "Ui-loading-wrap">            <P>Loading in progress ...</P>            <Iclass= "Ui-loading"></I>        </Div>    </Div>  

<Scripttype= "Text/javascript">        varTopfivechart= NewHighcharts.chart ({Chart: {renderto:'topfiveusers',//the element ID of the renderingType:'column'}, Title: {align:" Left", Text:'User report top five', Color:'#3E576F', FontSize:'16px'}, Subtitle: {text:'Data Update: Manual prefabrication', align:" Left",}, Xaxis: {categories: ["Jian Li", "Summer National Ball", "Li Shujun", "Zhang", "Luo Fei"]}, YAxis: {min:0, Title: {text:'number of bars (times)'}}, tooltip: {headerformat:'<span style= "font-size:10px" >{point.key}</span><table>', Pointformat:'<td style= "padding:0" ><b>{point.y:.f} bar </b></td></tr>', Footerformat:'</table>', GKFX:true, usehtml:true}, Plotoptions: {column: {colorbypoint:true, pointpadding:0.2, BorderWidth:0}}, colors: ['#ff5722', '#1aadce','#77a1e5', '#c42525', '#a6c96a'], Series: [{name:'escalation', data: [Ten, 9, 8, 2, 3], Showinlegend:false //set to False to not appear in the legend}], credits: {enabled:false            }      }); </Script>

Properties Summary:

1,renderto Note that this must be the id,type:column rectangle that renders the HTML element.

2,title title, subtitle subtitle, align:left position left

3,xaxis X-axis properties, categories category, configure data, here in order to demonstrate how to write dead a few data, generally through the AJAX tuning server data, assemble the array, through the dynamic configuration of parameters

4,yaxis Y-axis property, min minimum from zero, title default vertical title

5,tooltip prompt box, default mouse on the prompt, click on the mobile side to prompt, you can configure HTML elements, formatting and so on

6,plotoptions diagram configuration items, column columns Configure padding, borders, etc.

The default value in 7,colors,highcharts3.x is colors: [' #2f7ed8 ', ' #0d233a ', ' #8bbc21 ', ' #910000 ', ' #1aadce ', ' #492970 ', ' #f28f43 ', ' # 77a1e5 ', ' #c42525 ', ' #a6c96a ', of course, we can also manually select the color you like

8,series,name the name of the legend, the rectangle chart can be configured with multiple data columns, each data column can also have different color, detailed reference official website document, Showinlegend:false do not show the legend

9,credits, the copyright information of the chart, by default, the Highcharts chart will be placed at the bottom right of a link containing the copyright information, We can not display through the Enabled:false, can also text: own proprietary information, can also change the position properties and so on. Just a brief introduction here.

3, Render post-image effect

4, related events

Highcharts also provides events such as common chart click events, load events after the graph is loaded, redraw redraw, etc.

This only summarizes the few properties of the rectangular graph configuration, more detailed documentation can be consulted Highcharts Chinese network:

Online demo platform personally feel that the old version of the demonstration is more customary, at a glance, you can refer to the website:

Simple use of Highcharts

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: 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.