You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "echarts-bot[bot] (via GitHub)" <gi...@apache.org> on 2023/05/05 09:04:41 UTC

[GitHub] [echarts] echarts-bot[bot] commented on issue #18592: 如下图框出来的地方,怎么才能实现

echarts-bot[bot] commented on issue #18592:
URL: https://github.com/apache/echarts/issues/18592#issuecomment-1535955277

   @fff21 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. 🤗
   <details><summary><b>TRANSLATED</b></summary><br>
   
   **TITLE**
   
   How can it be realized in the place shown in the picture below?
   
   **BODY**
   
   ### What problem does this feature solve?
   
   ![Snipaste_2023-05-05_08-52-54](https://user-images.githubusercontent.com/130143783/236415961-0c94d854-0d23-4722-a888-5dd5e1b363d2.png)
   I tried many times on the place where the box came out, but the effect is still different. I hope to get your guidance (〃'▽'〃)
   
   
   ### What does the proposed API look like?
   
   `let option = {
          "xAxis": [
            {
              type: 'log',
              axisTick: {
                // axis ticks
                show: false,
              },
              axisLabel: {
                formatter: function (value) {
                  if (Math. abs(value) > 1000) {
                    if (value == 0) {
                      return "0";
                      // Check if it has been converted to scientific notation
                    } else if ((value + ''). indexOf('e') > 0) {
                      return (value + '').replace(/e/, "E");
                    } else {
                      var res = value. toString();
                      var numN1 = 0;
                      var numN2 = 1;
                      var num1 = 0;
                      var num2 = 0;
                      var t1 = 1;
                      // How many digits are counted before and after the decimal point
                      for (var k = 0; k < res. length; k++) {
                        if (res[k] == ".")
                          t1 = 0;
                        if (t1)
                          num1++;
                        else
                          num2++;
                      }
                      // Both are converted to scientific notation
                      if (Math. abs(value) < 1) {
                        // Start counting with one decimal place
                        for (var i = 2; i < res. length; i++) {
                          if (res[i] == "0") {
                            numN2++; //Record the negative index value of 10 (the default value starts from 1)
                          } else if (res[i] == ".")
                            continue;
                          else
                            break;
                        }
                        let v = parseFloat(value);
                        // 10 to the numN2 power
                        v = v * Math.pow(10, numN2);
                        v = v.toFixed(1); // rounded to keep only one decimal place
                        return v.toString() + "e-" + numN2;
                      } else if (num1 > 1) {
                        numN1 = num1 - 1;
                        let v = parseFloat(value);
                        v = v / Math.pow(10, numN1);
                        if (num2 > 1) {
                          v = v.toFixed(1);
                        }
                        return v.toString() + "e" + `+`+ numN1;
                      }
                    }
                  } else {
                    return value;
                  }
                }
              }
            },
            {
              "name": "β",
              "type": "value",
              axisTick: {
                // axis ticks
                show: false,
              },
            }
          ],
          title: [
            {
              left: 'center',
              text: 'Distribution probability map (Weibull)'
            },],
          yAxis: {
            type: 'log',
            axisTick: {
              // axis ticks
              show: false,
            },
          },
          series: [
            {
              data: [
                [299.977543, 0.01],
                [14677, 99],
              ],
              type: 'line',
              symbol: "none",
              itemStyle: {
                normal: {
                  // color: '#a80000', //Change the color of the polyline point
                  lineStyle: {
                    // color: '#a80000' //Change the polyline color
                  }
                }
              },
   
            },
            {
              data: [
                [150.977543, 0.01],
                [12477, 99],
              ],
              type: 'line',
              symbol: "none",
              itemStyle: {
                normal: {
                  // color: '#a80000', //Change the polyline color
                  lineStyle: {
                    type:'dashed', //'dotted' dotted dashed line 'solid' solid line 'dashed' linear dashed line
                    // color: '#a80000', //Change the color of the polyline point
                  },
                }
              },
   
            },
            {
              data: [
                [478.977543, 0.01],
                [18477, 99],
              ],
              type: 'line',
              symbol: "none",
              itemStyle: {
                normal: {
                  // color: '#a80000', //Change the polyline color
                  lineStyle: {
                    // width: 2,
                    type:'dashed', //'dotted' dotted dashed line 'solid' solid line 'dashed' linear dashed line
                    // color: '#a80000', //Change the color of the polyline point
   
                  }
                }
              },
            },
            {
              data: [
                [2001.977543, 1.123],
                [2300.977543, 1.1299],
                [2392.977543, 1.2299],
                [2333.345543, 1.54299],
                [2533.477543, 1.67599],
                [2673.6433543, 1.675429],
                [2677.76343, 1.67129],
                [3100.76343,2.1234],
                [3122.76343, 2.67129],
                [3233.76343, 2.7775429],
                [3333.76343, 2.897665],
                [3445.76343, 3.12345],
                [4133.76343, 4.23533],
                [4312.76343, 5.98776],
                [4423.76343, 6.45323],
                [4576.76343, 7.875776],
                [5627.76343, 8.2432],
                [5243.76343, 7.75432],
                [5632.76343, 8.23454],
                [5782.76343, 9.8653],
                [5821.76343, 10.24324],
                [5932.76343, 11.875776],
                [6121.76343, 12.24324],
                [7332.76343, 13.875776],
                [7442.76343, 15.23533],
                [8721.76343, 18.24324],
                [8832.76343, 21.875776],
                [9921.76343, 24.24324],
                [9332.76343, 31.875776],
                [9432.76343, 34.875776],
                [9532.76343, 46.875776],
                [9632.76343, 56.875776],
                [9999.76343, 63.875776],
                [11042.76343, 52.23533],
   
              ],
              type:'scatter',
              itemStyle: {
                normal: {
                  color: '#a80000', //Change the color of the polyline point
                  lineStyle: {
                    color: '#a80000' //Change the polyline color
                  }
                }
              },
            },
            {
   
              "type": "line",
              "xAxisIndex": 1,
   
            },
          ],
          tooltip: {
            trigger: 'axis',
            axisPointer: {
              type: 'cross'
            }
          },
        };`
   </details>


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