Echarts 누진 좌표가 정수 소수점으로 표시됩니다.

9643 단어
 1 chart.DoubleDeckBarChart = function (getIDParam, Legend, xAxisData, seriesName1, seriesName2, seriesData1, seriesData2, color1, color2) {
 2 
 3             require.config({paths: {echarts: '/lib/echarts'}});
 4 
 5             require(
 6                 [
 7                     'echarts',
 8                     'echarts/chart/bar'
 9                 ],
10                 function (ec) {
11                     var DoubleDeckBar = ec.init(getIDParam);
12                     var option = {
13                         tooltip: {
14                             trigger: 'axis',
15                             axisPointer: {            //
16                                 type: 'line'        //  , :'line' | 'shadow'
17                             }
18                         },
19                         legend: {
20                             data: Legend
21                         },
22                         grid: {
23                             x: '40',
24                             x2: '20',
25                             y2: '50',
26                             y: '38'
27                         },
28                         xAxis: [
29                             {
30                                 type: 'category',
31                                 data: xAxisData,
32                                 axisLabel: {
33                                     rotate: 40
34                                 },
35                             }
36                         ],
37                         yAxis: [
38                             {
39                                 type: 'value',
40                                 axisLabel: {
41                                     formatter: function (v) {
42                                         return parseInt(v)// 。 
43                                     }
44                                 }
45                                   // 
46                                   //axisLabel: {
47                                     //formatter: function (v) {
48                                        // return v.toFixed(2);   //0 0 ,1 1 ,2 2 
49                                     //}
50                                 //},
51                             }
52                         ],
53                         series: [
54                             {
55                                 name: seriesName2,
56                                 type: 'bar',
57                                 stack: ' ',
58                                 data: seriesData2,
59                                 itemStyle: {
60                                     normal: {
61                                         color: color2,
62                                     },
63 
64                                 },
65                             },
66                             {
67                                 name: seriesName1,
68                                 type: 'bar',
69                                 stack: ' ',
70                                 data: seriesData1,
71                                 itemStyle: {
72                                     normal: {
73                                         color: color1,
74                                     },
75 
76                                 },
77                             }
78 
79                         ]
80                     };
81 
82                     DoubleDeckBar.setOption(option, true);
83                 }
84             );
85         }
86                                     

좋은 웹페이지 즐겨찾기