| | |
| | | |
| | | // åå§åè¿7æ¥åºå
¥åºè¶å¿å¾ï¼å
³èåç«¯æ°æ®ï¼ |
| | | const initStockTrend = () => { |
| | | debugger |
| | | if (!stockTrendRef.value) return; |
| | | |
| | | if (stockTrendChart) { |
| | |
| | | // ä¼å
使ç¨åç«¯æ°æ® |
| | | const trendData = bigscreendata.value.dailyInOutBoundList; |
| | | console.log('åºå
¥åºè¶å¿æ°æ®', trendData); |
| | | |
| | | // è®¡ç®æ°æ®ä¸çæå¤§å¼ï¼ç¨äºè®¾ç½®Yè½´èå´ |
| | | const maxInbound = Math.max(...trendData.map(item => item.dailyInboundQuantity || 0)); |
| | | const maxOutbound = Math.max(...trendData.map(item => item.dailyOutboundQuantity || 0)); |
| | | const maxValue = Math.max(maxInbound, maxOutbound); |
| | | console.log('æå¤§å¼è®¡ç®ç»æ:', { maxInbound, maxOutbound, maxValue }); |
| | | |
| | | const option = { |
| | | tooltip: { |
| | |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | | name: 'æ°éï¼åä»¶ï¼', |
| | | max: 25 |
| | | name: 'æ°é', |
| | | min: 0, |
| | | // æ ¹æ®æ°æ®å¨æè®¾ç½®æå¤§å¼ï¼çåºä¸äºç©ºé´ |
| | | max: maxValue > 0 ? Math.ceil(maxValue * 1.2) : 10 |
| | | }, |
| | | series: [ |
| | | { |
| | | name: 'å
¥åºé', |
| | | type: 'bar', |
| | | barWidth: '30%', |
| | | data: trendData.map(item => item.inNum), |
| | | itemStyle: { color: '#52c41a' } |
| | | data: trendData.map(item => item.dailyInboundQuantity), |
| | | itemStyle: { |
| | | color: '#52c41a', |
| | | borderRadius: [4, 4, 0, 0] |
| | | } |
| | | }, |
| | | { |
| | | name: 'åºåºé', |
| | | type: 'bar', |
| | | barWidth: '30%', |
| | | data: trendData.map(item => item.outNum), |
| | | itemStyle: { color: '#1890ff' } |
| | | data: trendData.map(item => item.dailyOutboundQuantity), |
| | | itemStyle: { |
| | | color: '#1890ff', |
| | | borderRadius: [4, 4, 0, 0] |
| | | } |
| | | } |
| | | ] |
| | | }; |