@@ -8,8 +8,14 @@ Please visit http://gionkunz.github.io/chartist-js/plugins.html for more informa
88
99``` javascript
1010var defaultOptions = {
11- currency: null // accepts '£', '$', '€', etc.
11+ currency: undefined , // accepts '£', '$', '€', etc.
1212 // e.g. 4000 => €4,000
13+ tooltipFnc: undefined , // accepts function
14+ // build custom tooltip
15+ class: undefined , // accecpts 'class1', 'class1 class2', etc.
16+ // adds class(es) to tooltip wrapper
17+ appendToBody: false // accepts true or false
18+ // appends tooltips to body instead of chart container
1319};
1420```
1521
@@ -23,13 +29,13 @@ var chart = new Chartist.Line('.ct-chart', {
2329 labels: [1 , 2 , 3 ],
2430 series: [
2531 [
26- {meta: ' description' , value: 1 },
27- {meta: ' description' , value: 5 },
32+ {meta: ' description' , value: 1 },
33+ {meta: ' description' , value: 5 },
2834 {meta: ' description' , value: 3 }
2935 ],
3036 [
31- {meta: ' other description' , value: 2 },
32- {meta: ' other description' , value: 4 },
37+ {meta: ' other description' , value: 2 },
38+ {meta: ' other description' , value: 4 },
3339 {meta: ' other description' , value: 2 }
3440 ]
3541 ]
@@ -40,7 +46,7 @@ var chart = new Chartist.Line('.ct-chart', {
4046});
4147```
4248
43- without:
49+ without descriptive text :
4450``` js
4551var chart = new Chartist.Line (' .ct-chart' , {
4652 labels: [1 , 2 , 3 , 4 , 5 , 6 , 7 ],
@@ -54,3 +60,29 @@ var chart = new Chartist.Line('.ct-chart', {
5460 ]
5561});
5662```
63+
64+ With options text:
65+ ``` js
66+ var chart = new Chartist.Line (' .ct-chart' , {
67+ labels: [1 , 2 , 3 ],
68+ series: [
69+ [
70+ {meta: ' description' , value: 1 },
71+ {meta: ' description' , value: 5 },
72+ {meta: ' description' , value: 3 }
73+ ],
74+ [
75+ {meta: ' other description' , value: 2 },
76+ {meta: ' other description' , value: 4 },
77+ {meta: ' other description' , value: 2 }
78+ ]
79+ ]
80+ }, {
81+ plugins: [
82+ Chartist .plugins .tooltip ({
83+ currency: ' $' ,
84+ class: ' class1 class2' ,
85+ appendToBody: true
86+ })
87+ ]
88+ });
0 commit comments