@@ -10,6 +10,7 @@ require('echarts/lib/chart/line');
10
10
// 引入提示框和标题组件
11
11
require ( 'echarts/lib/component/tooltip' ) ;
12
12
require ( 'echarts/lib/component/title' ) ;
13
+ require ( 'echarts/lib/component/legend' ) ;
13
14
14
15
@inject ( 'ballChartStore' )
15
16
@observer
@@ -116,7 +117,20 @@ export default class BallChart extends React.Component<IProps> {
116
117
title : {
117
118
text : '红球分布图'
118
119
} ,
119
- tooltip : { } ,
120
+ tooltip : {
121
+ trigger : 'axis' ,
122
+ axisPointer : {
123
+ // lineStyle: {
124
+ // color: '#ddd'
125
+ // }
126
+ } ,
127
+ backgroundColor : 'rgba(255,255,255,1)' ,
128
+ // padding: [5, 10],
129
+ textStyle : {
130
+ color : '#7588E4' ,
131
+ } ,
132
+ extraCssText : 'box-shadow: 0 0 5px rgba(0,0,0,0.3)'
133
+ } ,
120
134
grid : {
121
135
left : '2%' ,
122
136
right : '2%' ,
@@ -127,9 +141,14 @@ export default class BallChart extends React.Component<IProps> {
127
141
data : reds . map ( v => v . name )
128
142
} ,
129
143
yAxis : { } ,
144
+ legend : {
145
+ right : 20 ,
146
+ orient : 'horizontal' ,
147
+ data : [ '红球1' , '红球2' , '红球3' , '红球4' , '红球5' , '红球6' ]
148
+ } ,
130
149
series : series ,
131
150
// color: ['#f54646','#f5464685','#f5464670','#f5464655','#f5464640','#f5464625']
132
- color : [ '#f54646' , '#c23531' , '#2f4554' , '#61a0a8' , '#d48265' , '#91c7ae ' , '#749f83' , '#ca8622' , '#bda29a' , '#6e7074' , '#546570' , '#c4ccd3' ]
151
+ color : [ '#f54646' , '#c23531' , '#2f4554' , '#61a0a8' , '#d48265' , '#6e7074 ' , '#749f83' , '#ca8622' , '#bda29a' , '#6e7074' , '#546570' , '#c4ccd3' ]
133
152
} )
134
153
} )
135
154
}
0 commit comments