Skip to content

Commit 8d95405

Browse files
author
Patric Gutersohn
committed
changed circliful from canvas to svg
1 parent 040f5c7 commit 8d95405

26 files changed

+6191
-878
lines changed

README.md

Lines changed: 26 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ jquery-plugin-circliful
22
=======================
33

44
- show Infos as Circle Statistics, no images used
5-
- based on html5 canvas and jquery
6-
- many options can be set as data attributes
7-
- fontawesome integration
5+
- based on SVG and jquery
6+
- many options can be set
7+
- fully responsive
88

99

1010
How to use circliful
@@ -17,64 +17,45 @@ Include circliful & jquery to your Site
1717
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
1818
<script src="js/jquery.circliful.min.js"></script>
1919

20-
If you want to use the fontawesome icons you also need to include the css file into your site.
2120

21+
Add an element to your Site with a unique id and an "container" arround it that controls the size of your circle statistic, here a example with bootstrap:
2222

23-
Add an element to your Site with a unique id an the data attributes that you need, for Example:
24-
25-
<div id="myStat" data-dimension="250" data-text="35%" data-info="New Clients" data-width="30" data-fontsize="38" data-percent="35" data-fgcolor="#61a9dc" data-bgcolor="#eee" data-fill="#ddd" data-total="200" data-part="35" data-icon="long-arrow-up" data-icon-size="28" data-icon-color="#fff"></div>
23+
<div class="row">
24+
<div class="col-lg-2">
25+
<div id="test-circle"></div>
26+
</div>
27+
</div>
2628

2729
Add this code at the end of your site
2830

2931
<script>
3032
$( document ).ready(function() {
31-
$('#myStat').circliful();
33+
$("#your-circle").circliful({
34+
animationStep: 5,
35+
foregroundBorderWidth: 5,
36+
backgroundBorderWidth: 15,
37+
percent: 75
38+
});
3239
});
3340
</script>
3441

3542

36-
Data Options (Attributes)
43+
Options
3744
-------------------------
3845

39-
you can set the options easily as data attributes for Example: data-dimension="250"
40-
4146
| Option | Description | Type | Default |
4247
| ------------- |:-------------:| -----:|-----:|
43-
| dimension | is the height and width of the element | Pixel | 200px on 200px |
44-
| text | will be displayed inside of the circle over the info element | string | - |
45-
| info | will be displayed inside of the circle bellow the text element (can be empty if you don't want to show info text) | string | - |
46-
| width | is the size of circle | Pixel | 15 |
47-
| fontsize | is the font size for the text element | Pixel | 15 |
48-
| percent | can be 1 to 100 | Pixel | integer | - |
49-
| fgcolor | is the foreground color of the circle | RGB | #556b2f |
50-
| bgcolor | is the background color of the cicle | RGB | #eee |
51-
| fill | is the background color of the whole circle (can be empty if you don't want to set a background to the whole circle) | RGB | - |
52-
| type | full or half circle for example data-type="half" if not set the circle will be a full circle | string | full |
53-
| total | If you want to display the percentage of a value for example you have 750MB Ram and at the moment are 350MB in use. You need to set data-total="750" and data-part="350" and the circle will show the percentage value 36,85% | Percent | - |
54-
| part | - | Percent | - |
55-
| border | Will change the styling of the circle. The line for showing the percentage value will be displayed inline or outline. | string | default |
56-
| icon | Fontawesome icon class without the fa- before the class for example not fa-plus just plus | Font Awesome | - |
57-
| iconsize | Will set the font size of the icon. | interger | - |
58-
| iconcolor | Will set the font color of the icon. | RGB | - |
59-
| animationstep | Will set the animation step, use 0 to disable animation, 0.5 to slow down, 2 to speed up, etc | interger | 1 |
60-
| startdegree | is the degree to start animate fgcolor | interger | 0 |
61-
| bordersize | set the width of the border | interger | 10 |
62-
| delay | set animation delay | interger | 0 |
63-
64-
48+
| foregroundColor | color of the foreground circle (no color add value 'none') | RGB or string | #3498DB |
49+
| backgroundColor | color of the background circle (no color add value 'none') | RGB or string | #eee |
50+
| fillColor | fill color of circle | RGB or string | none |
51+
| foregroundBorderWidth | width of foreground circle border | int | 15 |
52+
| backgroundBorderWidth | width of background circle border | int | 15 |
53+
| percent | can be 1 to 100 | Pixel | integer | 75 |
54+
| animation | if the circle should be animated initialy | int | 1 |
55+
| animationStep | can be 1 to 100, how fast or slow the animation should be | int | 5 |
56+
| percent | can be 1 to 100 | Pixel | integer | 75 |
6557

6658
Examples
6759
--------
68-
69-
##### Small Border Width
70-
![full](https://raw.github.com/pguso/jquery-plugin-circliful/master/preview/small-border-width.png)
71-
72-
##### Circle
73-
![full](https://raw.github.com/pguso/jquery-plugin-circliful/master/preview/full-cicle.PNG)
74-
75-
##### Filled Circle
76-
![filled](https://raw.github.com/pguso/jquery-plugin-circliful/master/preview/full-cicle-filled.PNG)
77-
78-
##### Half Circle Filled
79-
![half](https://raw.github.com/pguso/jquery-plugin-circliful/master/preview/half-cicle.PNG)
60+
![full](https://raw.github.com/pguso/jquery-plugin-circliful/master/preview/preview.png)
8061

css/circliful.css

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/* Import the Google Font 'Lato' */
2+
@import url(http://fonts.googleapis.com/css?family=Lato:300,400,700);
3+
4+
/* Container styles */
5+
body {
6+
background-color: #fff;
7+
color: #333;
8+
font-family: 'Lato', sans-serif;
9+
}
10+
11+
.outer {
12+
fill: transparent;
13+
stroke: #333;
14+
stroke-width: 19.8;
15+
stroke-dasharray: 534;
16+
transition: stroke-dashoffset 1s;
17+
-webkit-animation-play-state: running;
18+
/* firefox bug fix - won't rotate at 90deg angles */
19+
-moz-transform: rotate(-89deg) translateX(-190px);
20+
}
21+
22+
/* full circle 25 empty 534 */
23+
.inner {
24+
fill: transparent;
25+
stroke: orange;
26+
stroke-width: 20;
27+
stroke-dasharray: 534;
28+
transition: stroke-dashoffset 1s;
29+
-webkit-animation-play-state: running;
30+
/* firefox bug fix - won't rotate at 90deg angles */
31+
-moz-transform: rotate(-89deg) translateX(-190px);
32+
stroke-dashoffset: 0;
33+
}
34+
35+
.circliful {
36+
overflow: visible !important;
37+
38+
}
39+
40+
.svg-container {
41+
width: 100%;
42+
background: #fff;
43+
margin: 0 auto;
44+
overflow: visible;
45+
}

css/font-awesome.min.css

Lines changed: 0 additions & 4 deletions
This file was deleted.

css/jquery.circliful.css

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)