wylyl22 3 years ago
parent 28cc2f4ad3
commit a5449caa0b

@ -47,7 +47,7 @@ Component({
}) })
this.setData({ this.setData({
brandOption: histogram(arr,arr1,"#0084FF") brandOption: histogram(arr,arr1,"#20CC62")
}) })
setTimeout(() =>{ setTimeout(() =>{
wx.hideToast(); wx.hideToast();

@ -1,5 +1,5 @@
// 单柱状 // 单柱状
export default function histogram(dx=[],ds=[],data=[],color1='',direction=true) { export default function histogram(dx=[],ds=[],color1='',direction=true) {
// direction true为垂直 false为水平 // direction true为垂直 false为水平
return { return {
tooltip: { tooltip: {
@ -9,16 +9,23 @@ export default function histogram(dx=[],ds=[],data=[],color1='',direction=true)
}, },
confine: true confine: true
}, },
legend: { dataZoom: [{ //添加X轴滚动条
x:'15', type: 'inside',
icon: 'rectangle',//data图标样式 show: false,
itemWidth: '10',//data图标大小 start: 50,
itemHeight: '10', end: 10,
textStyle: { handleSize: 5
fontSize: '9' }],
}, // legend: {
data: data, // x:'15',
}, // icon: 'rectangle',//data图标样式
// itemWidth: '10',//data图标大小
// itemHeight: '10',
// textStyle: {
// fontSize: '9'
// },
// data: data,
// },
//图表位置 //图表位置
grid: { grid: {
left: 20, left: 20,

Loading…
Cancel
Save