kishore-uc commented on issue #20984:
URL: https://github.com/apache/echarts/issues/20984#issuecomment-2900000443

   version is "" "echarts": "^5.6.0",
       yAxis: {
         type: 'category',
         tooltip: {
           show: true,
           },
         data: [''],
         axisLabel: {
           formatter: (_: any, index: number) => {
             if (!this.data[index + 1][3]) {
               return `{primary|${ this.data[index + 1][0] } }`;
             }
             return `{primary|${ this.data[index + 1][0] }}\n\n{secondary|${
   this.data[index + 1][3] }}`;
           },
           rich: {
             primary: {
               color: '#005C87',
               fontWeight: 'bold',
               fontSize: 13,
             },
             secondary: {
               color: '#667683',
               fontWeight: 'semibold',
               fontSize: 14, // does not work as it takes primary font size
             },
           },
         },
         axisTick: { show: false }, // Remove unnecessary ticks
         axisLine: { show: false }, // Clean up axis line
         triggerEvent: true,
       },
   
   
   here i have added "tooltip: {show: true,},", so on hover the y-axis label
   tooltip appears, but inside tooltip {primary| } gets added, i dont want
   that. how to fix it. and also i will be adding "formatter: (_: any, index:
   number) => {
     // Function to truncate text to 30 chars with ellipsis
     const truncate = (text: string): string => {
       return text.length > 30 ? text.substring(0, 30) + '...' : text;
     };
   
     if (!this.data[index + 1][3]) {
       return {primary|${truncate(this.data[index + 1][0])}};
     }
     return {primary|${truncate(this.data[index +
   1][0])}}\n\n{secondary|${truncate(this.data[index + 1][3])}};
   },"   this code but primary adds over tooltip.
   
   On Thu, May 22, 2025 at 2:58 AM helgasoft ***@***.***> wrote:
   
   > *helgasoft* left a comment (apache/echarts#20984)
   > <https://github.com/apache/echarts/issues/20984#issuecomment-2899291895>
   >
   > yAxis show tooltip true, primary gets added on tooltip
   >
   > yAxis.axisLabel
   > <https://echarts.apache.org/en/option.html#yAxis.axisLabel%5D> has
   > *formatter* and *rich*,
   > but yAxis.tooltip
   > <https://echarts.apache.org/en/option.html#yAxis.tooltip> has only
   > *formatter*, so you cannot use 'rich' formatting in tooltip.
   >
   > —
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/echarts/issues/20984#issuecomment-2899291895>,
   > or unsubscribe
   > 
<https://github.com/notifications/unsubscribe-auth/AK5BNZSESFGRC3ZAO2LKXLD27TVZRAVCNFSM6AAAAAB5SX6CISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQOJZGI4TCOBZGU>
   > .
   > You are receiving this because you authored the thread.Message ID:
   > ***@***.***>
   >
   


-- 
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