You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/10/11 08:36:15 UTC

[GitHub] [echarts] ShawYuan97 opened a new issue #15858: how to change the Y axisLabel to base-10 exponential form ?

ShawYuan97 opened a new issue #15858:
URL: https://github.com/apache/echarts/issues/15858


   ### What problem does this feature solve?
   (fig)[https://www.google.com/imgres?imgurl=https%3A%2F%2Fdocs.gmt-china.org%2F5.4%2F_images%2Fbasemap-gmtplot-1.png&imgrefurl=https%3A%2F%2Fdocs.gmt-china.org%2F5.4%2Fgallery%2Fbasemap%2F&tbnid=7VWhkiQm6viDGM&vet=12ahUKEwjthafE-cHzAhWDI6YKHfN0DnMQMygMegUIARCzAQ..i&docid=ytdKSHyYa2yWaM&w=2061&h=1377&q=%E6%8C%87%E6%95%B0%E5%9D%90%E6%A0%87%E7%B3%BB&ved=2ahUKEwjthafE-cHzAhWDI6YKHfN0DnMQMygMegUIARCzAQ] 
   like this y axis Label 
   
   ### What does the proposed API look like?
   axisLabel
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   <!-- This issue is in English. DO NOT REMOVE -->


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] plainheart edited a comment on issue #15858: how to change the Y axisLabel to base-10 exponential form ?

Posted by GitBox <gi...@apache.org>.
plainheart edited a comment on issue #15858:
URL: https://github.com/apache/echarts/issues/15858#issuecomment-940589952


   参见以下两种方式
   
   ```js
   // 使用预设字符
   const superscripts = ['⁰', '¹', '²', '³', '⁴', '⁵', '⁶', '⁷', '⁸', '⁹'];
   function toSuperscript(val) {
     return (val + '')
       .split('')
       .map(t => superscripts[t])
       .join('');
   }
   
   // 使用 Unicode
   const superscriptUnicodes = ['B9', 'B2', 'B3'];
   function toSuperscript2(val) {
     return (val + '')
       .split('')
       .map(t => String.fromCharCode('0x' + (t > 0 && t < 4 ? superscriptUnicodes[t - 1] : '207' + t)))
       .join('');
   }
   ```
   
   然后 ECharts 添加 `axisLabel` 配置
   
   ```js
   axisLabel: {
       formatter: (val) => {
         // 2 为底数 val 为指数
        // toSuperscript 或 toSuperscript2 均可
         return 2 + toSuperscript(val);
       }
   }
   ```
   
   相似问题:#13363 #7062


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] ShawYuan97 removed a comment on issue #15858: how to change the Y axisLabel to base-10 exponential form ?

Posted by GitBox <gi...@apache.org>.
ShawYuan97 removed a comment on issue #15858:
URL: https://github.com/apache/echarts/issues/15858#issuecomment-939811852


   (fig)[https://www.google.com/imgres?imgurl=https%3A%2F%2Fdocs.gmt-china.org%2F5.4%2F_images%2Fbasemap-gmtplot-1.png&imgrefurl=https%3A%2F%2Fdocs.gmt-china.org%2F5.4%2Fgallery%2Fbasemap%2F&tbnid=7VWhkiQm6viDGM&vet=12ahUKEwjthafE-cHzAhWDI6YKHfN0DnMQMygMegUIARCzAQ..i&docid=ytdKSHyYa2yWaM&w=2061&h=1377&q=%E6%8C%87%E6%95%B0%E5%9D%90%E6%A0%87%E7%B3%BB&ved=2ahUKEwjthafE-cHzAhWDI6YKHfN0DnMQMygMegUIARCzAQ]


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] plainheart edited a comment on issue #15858: how to change the Y axisLabel to base-10 exponential form ?

Posted by GitBox <gi...@apache.org>.
plainheart edited a comment on issue #15858:
URL: https://github.com/apache/echarts/issues/15858#issuecomment-940589952


   参见以下两种方式
   
   ```js
   // 使用预设字符
   const superscripts = ['⁰', '¹', '²', '³', '⁴', '⁵', '⁶', '⁷', '⁸', '⁹'];
   function toSuperScript(val) {
     return (val + '')
       .split('')
       .map(t => superscripts[t])
       .join('');
   }
   
   // 使用 Unicode
   const superscriptUnicodes = ['B9', 'B2', 'B3'];
   function toSuperScript2(val) {
     return (val + '')
       .split('')
       .map(t => String.fromCharCode('0x' + (t > 0 && t < 4 ? superscriptUnicodes[t - 1] : '207' + t)))
       .join('');
   }
   ```
   
   然后 ECharts 添加 `axisLabel` 配置
   
   ```js
   axisLabel: {
       formatter: (val) => {
         // 2 为底数 val 为指数
        // toSuperScript 或 toSuperScript2均可
         return 2 + toSuperScript(val);
       }
   }
   ```
   
   相似问题:#13363 #7062


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] ShawYuan97 commented on issue #15858: how to change the Y axisLabel to base-10 exponential form ?

Posted by GitBox <gi...@apache.org>.
ShawYuan97 commented on issue #15858:
URL: https://github.com/apache/echarts/issues/15858#issuecomment-939811852


   (fig)[https://www.google.com/imgres?imgurl=https%3A%2F%2Fdocs.gmt-china.org%2F5.4%2F_images%2Fbasemap-gmtplot-1.png&imgrefurl=https%3A%2F%2Fdocs.gmt-china.org%2F5.4%2Fgallery%2Fbasemap%2F&tbnid=7VWhkiQm6viDGM&vet=12ahUKEwjthafE-cHzAhWDI6YKHfN0DnMQMygMegUIARCzAQ..i&docid=ytdKSHyYa2yWaM&w=2061&h=1377&q=%E6%8C%87%E6%95%B0%E5%9D%90%E6%A0%87%E7%B3%BB&ved=2ahUKEwjthafE-cHzAhWDI6YKHfN0DnMQMygMegUIARCzAQ]


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] plainheart edited a comment on issue #15858: how to change the Y axisLabel to base-10 exponential form ?

Posted by GitBox <gi...@apache.org>.
plainheart edited a comment on issue #15858:
URL: https://github.com/apache/echarts/issues/15858#issuecomment-940589952


   参见以下两种方式
   
   ```js
   // 使用预设字符
   const superscripts = ['⁰', '¹', '²', '³', '⁴', '⁵', '⁶', '⁷', '⁸', '⁹'];
   function toSuperScript(val) {
     return (val + '')
       .split('')
       .map(t => superscripts[t])
       .join('');
   }
   
   // 使用 Unicode
   const superscriptUnicodes = ['B9', 'B2', 'B3'];
   function toSuperScript2(val) {
     return (val + '')
       .split('')
       .map(t => String.fromCharCode('0x' + (t > 0 && t < 4 ? '00' + superscriptUnicodes[t - 1] : '207' + t)))
       .join('');
   }
   ```
   
   然后 ECharts 添加 `axisLabel` 配置
   
   ```js
   axisLabel: {
       formatter: (val) => {
         // 2 为底数 val 为指数
        // toSuperScript 或 toSuperScript2均可
         return '2' + toSuperScript(val);
       }
   }
   ```
   
   相似问题:#13363 #7062


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] echarts-bot[bot] commented on issue #15858: how to change the Y axisLabel to base-10 exponential form ?

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #15858:
URL: https://github.com/apache/echarts/issues/15858#issuecomment-939811680


   Hi! We've received your issue and please be patient to get responded. 🎉
   The average response time is expected to be within one day for weekdays.
   
   In the meanwhile, please make sure that it contains **a minimum reproducible demo** and necessary **images** to illustrate. Otherwise, our committers will ask you to do so.
   
   *A minimum reproducible demo* should contain as little data and components as possible but can still illustrate your problem. This is the best way for us to reproduce it and solve the problem faster.
   
   You may also check out the [API](http://echarts.apache.org/api.html) and [chart option](http://echarts.apache.org/option.html) to get the answer.
   
   If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical question.
   
   If you are interested in the project, you may also subscribe to our [mailing list](https://echarts.apache.org/en/maillist.html).
   
   Have a nice day! 🍵


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] plainheart edited a comment on issue #15858: how to change the Y axisLabel to base-10 exponential form ?

Posted by GitBox <gi...@apache.org>.
plainheart edited a comment on issue #15858:
URL: https://github.com/apache/echarts/issues/15858#issuecomment-940589952


   参见以下两种方式
   
   ```js
   // 使用预设字符
   const superscripts = ['⁰', '¹', '²', '³', '⁴', '⁵', '⁶', '⁷', '⁸', '⁹'];
   function getSuperScripts(val) {
     return (val + '')
       .split('')
       .map(t => superscripts[t])
       .join('');
   }
   
   // 使用 Unicode
   const superscriptsUnicode = ['B9', 'B2', 'B3'];
   function getSuperScripts2(val) {
     return (val + '')
       .split('')
       .map(t => String.fromCharCode('0x' + (t > 0 && t < 4 ? '00' + superscriptsUnicode[t - 1] : '207' + t)))
       .join('');
   }
   ```
   
   然后 ECharts 添加 `axisLabel` 配置
   
   ```js
   axisLabel: {
       formatter: (val) => {
         // 2 为底数 val 为指数
        // getSuperScripts 或 getSuperScripts2 均可
         return '2' + getSuperScripts2(val);
       }
   }
   ```
   
   相似问题:#13363 #7062


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] plainheart edited a comment on issue #15858: how to change the Y axisLabel to base-10 exponential form ?

Posted by GitBox <gi...@apache.org>.
plainheart edited a comment on issue #15858:
URL: https://github.com/apache/echarts/issues/15858#issuecomment-940589952


   参见以下两种方式
   
   ```js
   // 使用预设字符
   const superscripts = ['⁰', '¹', '²', '³', '⁴', '⁵', '⁶', '⁷', '⁸', '⁹'];
   function getSuperScripts(val) {
     return (val + '')
       .split('')
       .map(t => superscripts[t])
       .join('');
   }
   
   // 使用 Unicode
   const superscriptsUnicode = ['B9', 'B2', 'B3'];
   function getSuperScripts2(val) {
     return (val + '')
       .split('')
       .map(t => String.fromCharCode('0x' + (t > 0 && t < 4 ? '00' + superscriptsUnicode[t - 1] : '207' + t)))
       .join('');
   }
   ```
   
   然后 ECharts 添加 `axisLabel` 配置
   
   ```js
   axisLabel: {
       formatter: (val) => {
         // 2 为底数 val 为指数
        // getSuperScripts 或 getSuperScripts2 均可
         return '2' + getSuperScripts2(val);
       }
   }
   ```


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] ShawYuan97 commented on issue #15858: how to change the Y axisLabel to base-10 exponential form ?

Posted by GitBox <gi...@apache.org>.
ShawYuan97 commented on issue #15858:
URL: https://github.com/apache/echarts/issues/15858#issuecomment-939812308


   [fig](https://www.google.com/imgres?imgurl=https%3A%2F%2Fdocs.gmt-china.org%2F5.4%2F_images%2Fbasemap-gmtplot-1.png&imgrefurl=https%3A%2F%2Fdocs.gmt-china.org%2F5.4%2Fgallery%2Fbasemap%2F&tbnid=7VWhkiQm6viDGM&vet=12ahUKEwjthafE-cHzAhWDI6YKHfN0DnMQMygMegUIARCzAQ..i&docid=ytdKSHyYa2yWaM&w=2061&h=1377&q=%E6%8C%87%E6%95%B0%E5%9D%90%E6%A0%87%E7%B3%BB&ved=2ahUKEwjthafE-cHzAhWDI6YKHfN0DnMQMygMegUIARCzAQ)


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] plainheart commented on issue #15858: how to change the Y axisLabel to base-10 exponential form ?

Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #15858:
URL: https://github.com/apache/echarts/issues/15858#issuecomment-940589952


   参见以下两种方式
   
   ```js
   // 使用预设字符
   const superscripts = ['⁰', '¹', '²', '³', '⁴', '⁵', '⁶', '⁷', '⁸', '⁹'];
   function getSuperScripts(val) {
     return (val + '')
       .split('')
       .map((t) => superscripts[t])
       .join('');
   }
   
   // 使用 Unicode
   const superscriptsUnicode = ['B9', 'B2', 'B3'];
   function getSuperScripts2(val) {
     return (val + '')
       .split('')
       .map(
         (t) =>
           String.fromCharCode('0x' + (t > 0 && t < 4 ? '00' + superscriptsUnicode[t - 1] : '207' + t))
       )
       .join('');
   }
   ```
   
   然后 ECharts 添加 `axisLabel` 配置
   
   ```js
   axisLabel: {
       formatter: (val) => {
         // 2 为底数 val 为指数
        // getSuperScripts 或 getSuperScripts2 均可
         return '2' + getSuperScripts2(val);
       }
   }
   ```


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] plainheart closed issue #15858: how to change the Y axisLabel to base-10 exponential form ?

Posted by GitBox <gi...@apache.org>.
plainheart closed issue #15858:
URL: https://github.com/apache/echarts/issues/15858


   


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org