HTMLcopy
1
<div id="container"></div>
CSScopy
x
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
7
}
8
JavaScriptcopy
1040
1
anychart.onDocumentReady(function () {
2
// create pie chart with passed data
3
var chart = anychart.pie ([
4
5
{x: "Blanc", value: 3, code:"W96-8102",state:"selected",
6
hovered: {
7
8
hatchFill: {
9
type: "forward-diagonal",
10
color: "#ffffff",
11
thickness: 20
12
},
13
outline: {
14
enabled: false,
15
16
}
17
},
18
19
selected:{
20
outline: {
21
enabled: false,
22
23
}
24
}
25
},
26
{x: 'Vanille', value:3, code:"W96-1103",state:"selected",
27
hovered: {
28
29
hatchFill: {
30
type: "forward-diagonal",
31
color: "#f5e6bb",
32
thickness: 20
33
},
34
outline: {
35
enabled: false,
36
37
}
38
},
39
40
selected:{
41
outline: {
42
enabled: false,
43
44
}
45
}
46
},
47
{x: 'Sable', value: 3, code:"W96-8861",state:"selected",
48
hovered: {
49
50
hatchFill: {
51
type: "forward-diagonal",
52
color: "#ecd3b4",
53
thickness: 20
54
},
55
56
outline: {
57
enabled: false,
58
59
}
60
},
61
62
selected:{
63
outline: {
64
enabled: false,
65
66
}
67
}
68
},
69
{x: 'Gris galet', value:3, code:"W96-2171",state:"selected",
70
hovered: {
71
72
hatchFill: {
73
type: "forward-diagonal",
74
color: "#aeb2b3",
75
thickness: 20
76
},
77
outline: {
78
enabled: false,
79
80
}
81
},
82
83
selected:{
84
outline: {
85
enabled: false,
86
87
}
88
}
89
},
90
{x: 'Gris béton', value: 3, code:"W96-2047",state:"selected",
91
hovered: {
92
93
hatchFill: {
94
type: "forward-diagonal",
95
color: "#63666f",
96
thickness: 20
97
},
98
outline: {
99
enabled: false,
100
101
}
102
},
103
104
selected:{
105
outline: {
106
enabled: false,
107
108
}
109
}
110
},
111
112
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-1013",
113
114
hovered: {
115
116
hatchFill: {
117
type: "forward-diagonal",
118
color: "#fdc98a",
119
thickness: 20
120
}
121
}
122
123
},
124
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-1125",
125
126
hovered: {
127
128
hatchFill: {
129
type: "forward-diagonal",
130
color: "#325966",
131
thickness: 25
132
},
133
outline: {
134
enabled: false,
135
136
}
137
},
138
139
selected:{
140
outline: {
141
enabled: false,
142
143
}
144
}
145
},
146
147
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-1499",
148
hovered: {
149
150
hatchFill: {
151
type: "forward-diagonal",
152
color: "#bdc0c1",
153
thickness: 25
154
},
155
outline: {
156
enabled: false,
157
158
}
159
},
160
161
selected:{
162
outline: {
163
enabled: false,
164
165
}
166
}
167
},
168
169
170
171
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-2012",
172
hovered: {
173
174
hatchFill: {
175
type: "forward-diagonal",
176
color: "#a99181",
177
thickness: 25
178
},
179
outline: {
180
enabled: false,
181
182
}
183
},
184
185
selected:{
186
outline: {
187
enabled: false,
188
189
}
190
}
191
192
},
193
194
195
{x: '* Disponible sur commande selon quantité ', value: 1, code:"502-2135",
196
hovered: {
197
198
hatchFill: {
199
type: "forward-diagonal",
200
color: "#c3b4ad",
201
thickness: 25,
202
203
},
204
outline: {
205
enabled: false,
206
207
}
208
},
209
210
selected:{
211
outline: {
212
enabled: false,
213
214
}
215
}
216
},
217
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-2136",
218
hovered: {
219
220
hatchFill: {
221
type: "forward-diagonal",
222
color: "#322f31",
223
thickness: 25,
224
225
},
226
outline: {
227
enabled: false,
228
229
}
230
},
231
232
selected:{
233
outline: {
234
enabled: false,
235
236
}
237
}
238
239
},
240
241
242
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-2137",
243
hovered: {
244
245
hatchFill: {
246
type: "forward-diagonal",
247
color: "#65534a",
248
thickness: 25,
249
250
},
251
outline: {
252
enabled: false,
253
254
}
255
},
256
257
selected:{
258
outline: {
259
enabled: false,
260
261
}
262
}
263
},
264
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-2138",
265
hovered: {
266
267
hatchFill: {
268
type: "forward-diagonal",
269
color: "#896f52",
270
thickness: 25,
271
272
},
273
outline: {
274
enabled: false,
275
276
}
277
},
278
279
selected:{
280
outline: {
281
enabled: false,
282
283
}
284
}
285
},
286
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-2141",
287
hovered: {
288
289
hatchFill: {
290
type: "forward-diagonal",
291
color: "#b8978e",
292
thickness: 25,
293
294
},
295
outline: {
296
enabled: false,
297
298
}
299
},
300
301
selected:{
302
outline: {
303
enabled: false,
304
305
}
306
}
307
},
308
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-2144",
309
hovered: {
310
311
hatchFill: {
312
type: "forward-diagonal",
313
color: "#d0d3dc",
314
thickness: 25,
315
316
},
317
outline: {
318
enabled: false,
319
320
}
321
},
322
323
selected:{
324
outline: {
325
enabled: false,
326
327
}
328
}
329
},
330
331
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-2145",
332
hovered: {
333
334
hatchFill: {
335
type: "forward-diagonal",
336
color: "#d8d39c",
337
thickness: 25,
338
339
},
340
outline: {
341
enabled: false,
342
343
}
344
},
345
346
selected:{
347
outline: {
348
enabled: false,
349
350
}
351
}
352
},
353
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-2148",
354
hovered: {
355
356
hatchFill: {
357
type: "forward-diagonal",
358
color: "#73655b",
359
thickness: 25,
360
361
},
362
outline: {
363
enabled: false,
364
365
}
366
},
367
368
selected:{
369
outline: {
370
enabled: false,
371
372
}
373
}
374
},
375
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-2149",
376
hovered: {
377
378
hatchFill: {
379
type: "forward-diagonal",
380
color: "#4c5f57",
381
thickness: 25,
382
383
},
384
outline: {
385
enabled: false,
386
387
}
388
},
389
390
selected:{
391
outline: {
392
enabled: false,
393
394
}
395
}
396
},
397
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-2150",
398
hovered: {
399
400
hatchFill: {
401
type: "forward-diagonal",
402
color: "#b55d62",
403
thickness: 25,
404
405
},
406
outline: {
407
enabled: false,
408
409
}
410
},
411
412
selected:{
413
outline: {
414
enabled: false,
415
416
}
417
}
418
},
419
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-2151",
420
hovered: {
421
422
hatchFill: {
423
type: "forward-diagonal",
424
color: "#dfb1aa",
425
thickness: 25,
426
427
},
428
outline: {
429
enabled: false,
430
431
}
432
},
433
434
selected:{
435
outline: {
436
enabled: false,
437
438
}
439
}
440
},
441
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-2156",
442
hovered: {
443
444
hatchFill: {
445
type: "forward-diagonal",
446
color: "#335661",
447
thickness: 25,
448
449
},
450
outline: {
451
enabled: false,
452
453
}
454
},
455
456
selected:{
457
outline: {
458
enabled: false,
459
460
}
461
}
462
},
463
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-2157",
464
hovered: {
465
466
hatchFill: {
467
type: "forward-diagonal",
468
color: "#cbd038",
469
thickness: 25,
470
471
},
472
outline: {
473
enabled: false,
474
475
}
476
},
477
478
selected:{
479
outline: {
480
enabled: false,
481
482
}
483
}
484
},
485
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-2158",
486
hovered: {
487
488
hatchFill: {
489
type: "forward-diagonal",
490
color: "#83927f",
491
thickness: 25,
492
493
},
494
outline: {
495
enabled: false,
496
497
}
498
},
499
500
selected:{
501
outline: {
502
enabled: false,
503
504
}
505
}
506
},
507
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-2159",
508
hovered: {
509
510
hatchFill: {
511
type: "forward-diagonal",
512
color: "#66a5ce",
513
thickness: 25,
514
515
},
516
outline: {
517
enabled: false,
518
519
}
520
},
521
522
selected:{
523
outline: {
524
enabled: false,
525
526
}
527
}
528
},
529
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-2160",
530
hovered: {
531
532
hatchFill: {
533
type: "forward-diagonal",
534
color: "#00a2bd",
535
thickness: 25,
536
537
},
538
outline: {
539
enabled: false,
540
541
}
542
},
543
544
selected:{
545
outline: {
546
enabled: false,
547
548
}
549
}
550
},
551
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-2161",
552
hovered: {
553
554
hatchFill: {
555
type: "forward-diagonal",
556
color: "#005e86",
557
thickness: 25,
558
559
},
560
outline: {
561
enabled: false,
562
563
}
564
},
565
566
selected:{
567
outline: {
568
enabled: false,
569
570
}
571
}
572
},
573
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-2162",
574
hovered: {
575
576
hatchFill: {
577
type: "forward-diagonal",
578
color: "#626269",
579
thickness: 25,
580
581
},
582
outline: {
583
enabled: false,
584
585
}
586
},
587
588
selected:{
589
outline: {
590
enabled: false,
591
592
}
593
}
594
},
595
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-2163",
596
hovered: {
597
598
hatchFill: {
599
type: "forward-diagonal",
600
color: "#aea0a4",
601
thickness: 25,
602
603
},
604
outline: {
605
enabled: false,
606
607
}
608
},
609
610
selected:{
611
outline: {
612
enabled: false,
613
614
}
615
}
616
},
617
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-2164",
618
hovered: {
619
620
hatchFill: {
621
type: "forward-diagonal",
622
color: "#9796ae",
623
thickness: 25,
624
625
},
626
outline: {
627
enabled: false,
628
629
}
630
},
631
632
selected:{
633
outline: {
634
enabled: false,
635
636
}
637
}
638
},
639
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-2165",
640
hovered: {
641
642
hatchFill: {
643
type: "forward-diagonal",
644
color: "#695268",
645
thickness: 25,
646
647
},
648
outline: {
649
enabled: false,
650
651
}
652
},
653
654
selected:{
655
outline: {
656
enabled: false,
657
658
}
659
}
660
},
661
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-2166",
662
hovered: {
663
664
hatchFill: {
665
type: "forward-diagonal",
666
color: "#fdbb48",
667
thickness: 25,
668
669
},
670
outline: {
671
enabled: false,
672
673
}
674
},
675
676
selected:{
677
outline: {
678
enabled: false,
679
680
}
681
}
682
},
683
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-2167",
684
hovered: {
685
686
hatchFill: {
687
type: "forward-diagonal",
688
color: "#656b89",
689
thickness: 25,
690
691
},
692
outline: {
693
enabled: false,
694
695
}
696
},
697
698
selected:{
699
outline: {
700
enabled: false,
701
702
}
703
}
704
},
705
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-2168",
706
hovered: {
707
708
hatchFill: {
709
type: "forward-diagonal",
710
color: "#a8a9ad",
711
thickness: 25,
712
713
},
714
outline: {
715
enabled: false,
716
717
}
718
},
719
720
selected:{
721
outline: {
722
enabled: false,
723
724
}
725
}
726
},
727
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-2171",
728
hovered: {
729
730
hatchFill: {
731
type: "forward-diagonal",
732
color: "#babec3",
733
thickness: 25,
734
735
},
736
outline: {
737
enabled: false,
738
739
}
740
},
741
742
selected:{
743
outline: {
744
enabled: false,
745
746
}
747
}
748
},
749
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-2172",
750
hovered: {
751
752
hatchFill: {
753
type: "forward-diagonal",
754
color: "#e6724b",
755
thickness: 25,
756
757
},
758
outline: {
759
enabled: false,
760
761
}
762
},
763
764
selected:{
765
outline: {
766
enabled: false,
767
768
}
769
}
770
},
771
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-2173",
772
hovered: {
773
774
hatchFill: {
775
type: "forward-diagonal",
776
color: "#c27450",
777
thickness: 25,
778
779
},
780
outline: {
781
enabled: false,
782
783
}
784
},
785
786
selected:{
787
outline: {
788
enabled: false,
789
790
}
791
}
792
},
793
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-8056",
794
hovered: {
795
796
hatchFill: {
797
type: "forward-diagonal",
798
color: "#00523e",
799
thickness: 25,
800
801
},
802
outline: {
803
enabled: false,
804
805
}
806
},
807
808
selected:{
809
outline: {
810
enabled: false,
811
812
}
813
}
814
},
815
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-8204",
816
hovered: {
817
818
hatchFill: {
819
type: "forward-diagonal",
820
color: "#f68740",
821
thickness: 25,
822
823
},
824
outline: {
825
enabled: false,
826
827
}
828
},
829
830
selected:{
831
outline: {
832
enabled: false,
833
834
}
835
}
836
},
837
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-8255",
838
hovered: {
839
840
hatchFill: {
841
type: "forward-diagonal",
842
color: "#aa5147",
843
thickness: 25,
844
845
},
846
outline: {
847
enabled: false,
848
849
}
850
},
851
852
selected:{
853
outline: {
854
enabled: false,
855
856
}
857
}
858
},
859
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-8284",
860
hovered: {
861
862
hatchFill: {
863
type: "forward-diagonal",
864
color: "#634244",
865
thickness: 25,
866
867
},
868
outline: {
869
enabled: false,
870
871
}
872
},
873
874
selected:{
875
outline: {
876
enabled: false,
877
878
}
879
}
880
},
881
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-8341",
882
hovered: {
883
884
hatchFill: {
885
type: "forward-diagonal",
886
color: "#fff5d3",
887
thickness: 25,
888
889
},
890
outline: {
891
enabled: false,
892
893
}
894
},
895
896
selected:{
897
outline: {
898
enabled: false,
899
900
}
901
}
902
},
903
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-8450",
904
hovered: {
905
906
hatchFill: {
907
type: "forward-diagonal",
908
color: "#5c5d5f",
909
thickness: 25,
910
911
},
912
outline: {
913
enabled: false,
914
915
}
916
},
917
918
selected:{
919
outline: {
920
enabled: false,
921
922
}
923
}
924
},
925
{x: '* Disponible sur commande selon quantité', value: 1, code:"502-8861",
926
hovered: {
927
928
hatchFill: {
929
type: "forward-diagonal",
930
color: "#e7ccb5",
931
thickness: 25,
932
933
},
934
outline: {
935
enabled: false,
936
937
}
938
},
939
940
selected:{
941
outline: {
942
enabled: false,
943
944
}
945
}
946
}
947
]);
948
949
950
951
// configure the states of the chart
952
953
chart.normal().stroke("#f9c975", 0);
954
chart.hovered().stroke("#f9c975", 6);
955
chart.normal().explode("0%");
956
chart.hovered().explode("5%");
957
958
959
// set tooltip text template
960
var tooltip = chart.tooltip();
961
// tooltip padding for all series on a chart
962
chart.tooltip().padding().left(20);
963
tooltip.format("{%x}");
964
tooltip.format("Référence {%code} PVC Serge Ferrari");
965
966
967
968
969
// create range color palette with color ranged between light blue and dark blue
970
var palette = anychart.palettes.rangeColors();
971
palette.items([
972
{color: '#ffffff'}, //blanc
973
{color: '#f5e6bb'}, //vanille
974
{color: '#ecd3b4'}, //sable
975
{color: '#aeb2b3'}, //gris-galet
976
{color: '#63666f'}, //gris-béton
977
{color: '#fdc98a'}, //Ref 502-1013
978
{color: '#325966'}, //Ref 502-1125
979
{color: '#bdc0c1'}, //Ref 502-1499
980
{color: '#a99181'}, //Ref 502-2012
981
{color: '#c3b4ad'}, //Ref 502-2135
982
{color: '#322f31'}, //Ref 502-2136
983
{color: '#65534a'}, //Ref 502-2137
984
{color: '#896f52'}, //Ref 502-2138
985
{color: '#b8978e'}, //Ref 502-2141
986
{color: '#d0d3dc'}, //Ref 502-2144
987
{color: '#d8d39c'}, //Ref 502-2145
988
{color: '#73655b'}, //Ref 502-2148
989
{color: '#4c5f57'}, //Ref 502-2149
990
{color: '#b55d62'}, //Ref 502-2150
991
{color: '#dfb1aa'}, //Ref 502-2151
992
{color: '#335661'}, //Ref 502-2156
993
{color: '#cbd038'}, //Ref 502-2157
994
{color: '#83927f'}, //Ref 502-2158
995
{color: '#66a5ce'}, //Ref 502-2159
996
{color: '#00a2bd'}, //Ref 502-2160
997
{color: '#005e86'}, //Ref 502-2161
998
{color: '#626269'}, //Ref 502-2162
999
{color: '#aea0a4'}, //Ref 502-2163
1000
{color: '#9796ae'}, //Ref 502-2164
1001
{color: '#695268'}, //Ref 502-2165
1002
{color: '#fdbb48'}, //Ref 502-2166
1003
{color: '#656b89'}, //Ref 502-2167
1004
{color: '#a8a9ad'}, //Ref 502-2168
1005
{color: '#babec3'}, //Ref 502-2171
1006
{color: '#e6724b'}, //Ref 502-2172
1007
{color: '#c27450'}, //Ref 502-2173
1008
{color: '#00523e'}, //Ref 502-8056
1009
{color: '#f68740'}, //Ref 502-8204
1010
{color: '#aa5147'}, //Ref 502-8255
1011
{color: '#634244'}, //Ref 502-8284
1012
{color: '#fff5d3'}, //Ref 502-8341
1013
{color: '#5c5d5f'}, //Ref 502-8450
1014
{color: '#e7ccb5'} //Ref 502-8861
1015
]);
1016
// set the explosion range
1017
chart.explode("5%");
1018
1019
1020
1021
// set chart title text settings
1022
chart.title('')
1023
//set chart radius
1024
.innerRadius('30%')
1025
// set palette to the chart
1026
.palette(palette);
1027
1028
// disable labels
1029
chart.labels(false);
1030
1031
var background = chart.background();
1032
1033
// Set fill.
1034
background.fill( '#424242',0);
1035
1036
// set container id for the chart
1037
chart.container('container');
1038
// initiate chart drawing
1039
chart.draw();
1040
});