Highcharts-bar Chart

Source: Internet
Author: User

1. The bar chart requires the following types of data formats:

["Luke Skywalker", "Darth Vader", "Yoda", "Princess Leia"] [2, 4, 1, 1]

2. Bar Chart code example:

$(function () {    $(' #container '). Highcharts ({chart: {type:' Bar '}, Xaxis: {categories: [' Jan ', ' Feb ', ' Mar ', ' Apr ', ' may ', ' June ', ' Jul ', ' April ', ' Sep ', ' Oct ', ' Nov ', ' Dec ']}, Plotoptions: {series: {allowpointselect:true}}, yaxis:{min:0, Title: {text:' Sales '}, the series: [{data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]        }]    }); //The button action$ (' #button '). Click (function () {        varselectedpoints = $ (' #container '). Highcharts (). getselectedpoints (); Alert (' You selected ' + Selectedpoints.length + ' points '); });});
View Code

3. The difference between a histogram (column chart) and a bar chart (bar chart) is that the type attribute of the chart is different, one is column and one bar, but the data and formatting are the same; Change the Type property of chart in item 2 to Column , you can get the following effect:

4. If you need to display the results of different states in the same category (Stackedbar), the data format needs to be modified accordingly:

["Luke Skywalker", "Princess Leia", "Yoda", "Darth Vader"][{"Completed", [1, 0, 0, 1]},{"Active", [1, 1, 1, 2]},{ "Pipeline", [0, 0, 0, 1]}]

5.

Highcharts-bar Chart

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.