echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Feature] Hope "tooltip" supports "rich". 希望“tooltip”支持“rich”

Open leekbillow opened this issue 2 years ago • 5 comments

What problem does this feature solve?

目前tooltip不支持richrenderMode:'richText'似乎是一个没用的选项,在没有dom的微信小程序里,没办法自定义不同的样式。 Currently, richis not supported bytooltip, andrenderMode:'richText'seems to be a useless option. In wechat applets without DOM, there is no way to customize different styles.

option = {
  tooltip: {
    renderMode: 'richText',
    formatter({ name, value }) {
      return `{name|${name}}:{value|${value}}`;
    },
    // invalid 无效
    rich: {
      name: { color: 'red' },
      value: { color: 'blue' }
    },
    textStyle: {
      // invalid 无效
      rich: {
        name: { color: 'red' },
        value: { color: 'blue' }
      }
    }
  },
  xAxis: {
    type: 'category',
    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  },
  yAxis: {
    type: 'value'
  },
  series: [
    {
      data: [120, 200, 150, 80, 70, 110, 130],
      type: 'bar'
    }
  ]
};

What does the proposed API look like?

tooltip.rich or tooltip.textStyle.rich

leekbillow avatar Aug 22 '22 08:08 leekbillow

@leekbillow It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗

TRANSLATED

TITLE

[Feature] Hope "tooltip" supports "rich". Hope "tooltip" supports "rich"

BODY

What problem does this feature solve?

Currently tooltip does not support rich, renderMode:'richText' seems to be a useless option, in WeChat applet without dom, there is no way to customize different styles. Currently, rich is not supported by tooltip, and renderMode:'richText'seems to be a useless option. In wechat applets without DOM, there is no way to customize different styles.

option = {
  tooltip: {
    renderMode: 'richText',
    formatter({ name, value }) {
      return `{name|${name}}:{value|${value}}`;
    },
    // invalid is invalid
    rich: {
      name: { color: 'red' },
      value: { color: 'blue' }
    },
    textStyle: {
      // invalid is invalid
      rich: {
        name: { color: 'red' },
        value: { color: 'blue' }
      }
    }
  },
  xAxis: {
    type: 'category',
    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  },
  yAxis: {
    type: 'value'
  },
  series: [
    {
      data: [120, 200, 150, 80, 70, 110, 130],
      type: 'bar'
    }
  ]
};

What does the proposed API look like?

tooltip.rich or tooltip.textStyle.rich

echarts-bot[bot] avatar Aug 22 '22 08:08 echarts-bot[bot]

tooltip does suppot richText

susiwen8 avatar Sep 18 '22 02:09 susiwen8

I have the same problem

xiaofan10 avatar May 24 '23 07:05 xiaofan10