nitxs commented on issue #19477:
URL: https://github.com/apache/echarts/issues/19477#issuecomment-1882081251

   Tooltip 
我已经设置了开盘价、收盘价、最低价、最高价,需求是这几个单独一个框显示,而MA值是要放在左上角固定显示,也就是我可能需要设置两个tooltip,该如何实现呢?
   `tooltip: {
           trigger: 'axis',
           padding: [0,4], // 提示框 上下的内边距为 0,左右的内边距为 4
           position: function (pos, params, el, elRect, size) {
             var obj = { top: 8 };
             obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 0;
             return obj;
           },
           formatter:(params, ticket, callback)=> {
             console.log(params)
             // [开盘价,收盘价,最低价,最高价]
             let param = params[0]
             const tooltipText = 
`${param.name}\n开${param.data[1]}\n收${param.data[2]}\n低${param.data[3]}\n高${param.data[4]}`
             return tooltipText
   
           },
           axisPointer: {
             animation: false,
             type: 'cross',
             lineStyle: {
               color: '#376df4',
               width: 2,
               opacity: 1
             }
           }
         },`
   我现在选择在graphic中设置显示MA均线值,如果可能想请问下,如何在鼠标滑动时也动态更新graphic设置的MA值?
   `graphic: [
           {
             id: 'graphicMaIdA',
             type: 'text',
             left: 10,  // 右边距
             top: 3, // 底边距
             style: {
               text: 'MA5: MA10: MA20: MA40: MA60:',
               fill: '#000',  // 字体颜色
               font: '10px Arial',  // 字体样式
               lineHeight: 18,  // 行高
               width: 150,  // 文本宽度,超出宽度会换行
               // overflow: 'truncate',  // 超出宽度截断显示
             },
           },
         ],`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to