jquery Circular Chart Real-combat development

Source: Internet
Author: User

Today I will introduce you to a circular chart circliful, which is based on the HTML5 canvas and jquery, without the need for an image to easily implement a circular chart, and has a lot of property settings, easy to use.

First we need to introduce the jquery library file and the Jquery.circliful.min.js into the page

Java code
    1. <script src="Http://code.jquery.com/jquery-1.10.2.min.js" ></script>
    2. <script src="Js/jquery.circliful.min.js" ></script>

Once the required jquery file is introduced, we can now customize the basic style of the circular chart:

Java code
  1. <style>
  2. . circliful {
  3. position:relative;
  4. }
  5. . Circle-text,. Circle-info,. Circle-text-half,. circle-info-half {
  6. Width: 100%;
  7. Position:absolute;
  8. Text-align:center;
  9. Display:inline-block;
  10. }
  11. . Circle-info,. circle-info-half {
  12. Color: #999;
  13. }
  14. . circliful. FA {
  15. Margin: -10px 3px 0 3px;
  16. position:relative;
  17. bottom:4px;
  18. }
  19. </style>

Once the style is initially defined, simply add the following style code where you want the chart:

Java code
    1. <div id="Mystat" data-dimension="$" data-text="35%" data-info="New clients"
    2. Data-width= "data-fontsize="data-percent= "data-fgcolor=" #61a9dc "
    3. Data-bgcolor= "#eee" data-fill= "#ddd" ></div>

After the area block has been filled out, we now need to initialize it:

Java code
    1. <script>
    2. $ (document). Ready (function () {
    3. $ (' #myStat '). circliful ();
    4. });
    5. </script>

As simple as this, just a few easy to complete a handsome statistical chart.

The following is a description of the basic properties of the plugin:

Circliful provides a rich set of property options, based on the HTML5 data property, and the following is the Setup checklist.

Parameters Describe Default value
Data-dimension Width and height of the circular chart px 250
Data-text Text content displayed inside the circle Empty
Data-info Description information displayed under Data-text Empty
Data-width The thickness of the circle px 15
Data-fontsize Circle Text Size px 15
Data-percent Circle Statistics percent%,1-100 50
Data-fgcolor The foreground color of the circle #556b2f
Data-bgcolor The background color of the circle #eeeeee
Data-fill Rounded Fill background color Empty
Data-type Circular statistic type, which can be "half" or "full" Full
Data-total Total data, used in conjunction with Data-part Empty
Data-part Amount of data, used in conjunction with Data-total Empty
Data-border Circular style, can be added border, such as inline or outline Empty
Data-icon Fontawesome icon style, details can be referred to: Fontawesome website–icons Empty
Data-icon-size Icon size Empty
Data-icon-color Icon Color

jquery Circular Chart Real-combat development

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.