Highcharts Learning Axis _javascript class Library

Source: Internet
Author: User
Tags datetime

Objective

All charts have x and Y axes in addition to pie charts, by default, the x axis is displayed at the bottom of the chart, the y-axis appears on the left side (multiple y axes can be displayed on both sides), and chart.inverted = true you can set the x,y axis display position to swap.

Next, learn to learn highcharts axes.

Tags

1. Title

xaxis:{
  title:{
    text: ' x Axis title '
  }
}
yaxis:{
  title:{
    text: ' Y-axis title '
  }
}

2. Label

Labels:enabled, Formatter, SETP

yaxis:{
        labels:{
         enabled:true,
         formatter:function () {
           if (This.value <=3) {return
             "first rank (" + This.value+ ")";
           } else if (this.value >3 && this.value <=5) {return
             "second rank (" +this.value+ ")";
           } else {return
             "third rank (" +this.value+ ")";
           }
         ,
         step:1  //interval several lines show once
        }

3. Grid

1.gridLineWidth

Grid line width. The X axis defaults to the 0,y axis by default of 1px.

2.gridLineColor

Grid line Color. The default is : #C0C0C0.

3.gridLineDashStyle

Gridlines Line style. and CSS Border-style Similar, commonly used are:Solid, Dot, Dash.

yaxis:{
 //gridlinewidth: ' 1px ',  /Note If this property is used Gridlinedashstyle will not work
 GridlineColor: ' #019000 ',
 Gridlinedashstyle: ' Dash ',
}

4. Type

xaxis:{
   categories:[' A ', ' B ', ' C '
  },
yaxis:{
   type: ' DateTime '
  },

5.reversed

Upside down is to flip the axis instead of x and Y. For example, the y-axis inversion result is that the y-axis starts with the maximum value, and the minimum value is at the bottom.

xaxis:{
        categories:[' A ', ' B ', ' C ',
        reversed:true
      },
      yaxis:{
        type: ' DateTime ',
        Reversed:true
      },

6.opposite

When its value is set to True, the X and Y axes are positioned up and down, respectively.

xaxis:{
        categories:[' A ', ' B ', ' C ',
        opposite:true
      },
      yaxis:{
        type: ' DateTime ',
        opposite: True
      }

7.inverted

chart:{
        type: ' line ',
        style:{
          fontsize: ' 17px ',
        },
        inverted:true
      }

8.min, Max

Controls the minimum and maximum values for the axis.

Note: control allowdecimals, Min, max properties you can easily control the display range of the axis, etc. (this is also a common problem)

Summarize

The above is the entire content of this article, have you learned? Small series will continue to update Highcharts's article, Highcharts interested friends to continue to pay attention to the cloud habitat community, hope this article to help you learn.

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.