rapid-spreadjs 1.0.167 → 1.0.169

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -8539,256 +8539,99 @@ const EChartsUtilsAll = {
8539
8539
  * @returns 返回ECharts配置项
8540
8540
  */
8541
8541
  chart350: (config, xDataArr, yDataArr, sheet) => {
8542
- let lineData = JSON.parse(config.chartLinesJson), lineColor = lineData[0].lineColor;
8542
+ let lineData = JSON.parse(config.chartLinesJson); lineData[0].lineColor;
8543
8543
  const chartExtJson = config.chartExtJson == null || config.chartExtJson == undefined ? null : JSON.parse(config.chartExtJson);
8544
- //击数N(次)、含水率w(%)、y轴第一个趋势数据、y轴第二个趋势数据、25的趋势数据、y轴最小值、y轴最大值
8545
- const jsN = [xDataArr[0][0], xDataArr[0][1]], // [18, 30],
8546
- hsl = [yDataArr[0][0], yDataArr[0][1]], // [22.1, 11.5],
8547
- //通过calcTrend获取y轴第一个趋势数据、y轴第二个趋势数据、25的趋势数据
8548
- yVal1 = Number(EChartsUtilsComm.getRound(EChartsUtilsComm.calcTrend(jsN, hsl, jsN[0]).y, 0.1)), yVal2 = Number(EChartsUtilsComm.getRound(EChartsUtilsComm.calcTrend(jsN, hsl, jsN[1]).y, 0.1)), yVal25 = Number(EChartsUtilsComm.getRound(EChartsUtilsComm.calcTrend(jsN, hsl, 25).y, 0.1)),
8549
- //通过calcTrend获取y轴的趋势数据,然后分别-2和+2
8550
- yAxisMin = Math.floor(Number(yVal2)) - 2, yAxisMax = Math.floor(Number(yVal1)) + 2;
8551
- let title = config.chartTitle, xName = config.chartXName, yName = config.chartYName, legendName = '图例1';
8544
+ // //击数N(次)、含水率w(%)、y轴第一个趋势数据、y轴第二个趋势数据、25的趋势数据、y轴最小值、y轴最大值
8545
+ // const jsN = [xDataArr[0][0], xDataArr[0][1]], // [18, 30],
8546
+ // hsl = [yDataArr[0][0], yDataArr[0][1]], // [22.1, 11.5],
8547
+ // //通过calcTrend获取y轴第一个趋势数据、y轴第二个趋势数据、25的趋势数据
8548
+ // yVal1 = Number(EChartsUtilsComm.getRound(EChartsUtilsComm.calcTrend(jsN, hsl, jsN[0]).y, 0.1)),
8549
+ // yVal2 = Number(EChartsUtilsComm.getRound(EChartsUtilsComm.calcTrend(jsN, hsl, jsN[1]).y, 0.1)),
8550
+ // yVal25 = Number(EChartsUtilsComm.getRound(EChartsUtilsComm.calcTrend(jsN, hsl, 25).y, 0.1)),
8551
+ // //通过calcTrend获取y轴的趋势数据,然后分别-2和+2
8552
+ // yAxisMin = Math.floor(Number(yVal2)) - 2,
8553
+ // yAxisMax = Math.floor(Number(yVal1)) + 2;
8554
+ let title = config.chartTitle, xName = config.chartXName, yName = config.chartYName;
8552
8555
  //检测是否所有数据都为空
8553
8556
  let isAllNull = true;
8554
8557
  isAllNull = xDataArr[0].filter((item) => item != null && item != undefined && item != '/').length == 0;
8555
8558
  if (isAllNull) {
8556
8559
  isAllNull = yDataArr[0].filter((item) => item != null && item != undefined && item != '/').length == 0;
8557
8560
  }
8558
- //x和y轴的字体大小
8559
- const xyFontSize = 8;
8560
- let seriesObjs = [
8561
+ var LOG = Math.log10;
8562
+ /* ==========================================================
8563
+ 1. 数据源(只需改这里,其余全部自动适配)
8564
+ ========================================================== */
8565
+ var x1 = xDataArr[0][0], y1 = yDataArr[0][0]; // a1
8566
+ var x3 = xDataArr[0][1], y3 = yDataArr[0][1]; // a3
8567
+ var x2 = 25; // 待求插值点
8568
+ /* ==========================================================
8569
+ 2. 插值计算(对数空间线性插值)
8570
+ ========================================================== */
8571
+ var logX1 = LOG(x1), logX2 = LOG(x2), logX3 = LOG(x3);
8572
+ var t = (logX2 - logX1) / (logX3 - logX1);
8573
+ var y2 = y1 + t * (y3 - y1);
8574
+ var slope = (y3 - y1) / (logX3 - logX1);
8575
+ // 两端延长:取数据对数跨度的 15%,保证"延长一点"且随数据自适应
8576
+ var ext = (logX3 - logX1) * 0.15;
8577
+ var extLX = logX1 - ext, extLY = y1 + slope * -ext;
8578
+ var extRX = logX3 + ext, extRY = y3 + slope * ext;
8579
+ /* ==========================================================
8580
+ 3. Y 轴范围自适应算法
8581
+ ========================================================== */
8582
+ // 把任意数值规整为 1 / 2 / 5 × 10^n 的"整洁数"
8583
+ function niceNum(range, round) {
8584
+ var exponent = Math.floor(Math.log10(range));
8585
+ var fraction = range / Math.pow(10, exponent);
8586
+ var niceFraction;
8561
8587
  {
8562
- name: legendName,
8563
- type: 'line',
8564
- //设置数据点形状(实心),参考文档:https://echarts.apache.org/zh/option.html#series-line.symbol
8565
- symbol: 'circle',
8566
- z: 10, //控制曲线的浮动层级,避免在markLine下方被遮住
8567
- //线条的颜色
8568
- lineStyle: {
8569
- color: lineColor,
8570
- //线条类型(solid:实线、dashed:粗虚线、dotted:细虚线)
8571
- // type: 'dotted',
8572
- },
8573
- //线条上数据点的颜色
8574
- itemStyle: {
8575
- color: lineColor,
8576
- },
8577
- connectNulls: true, //是否连接空数据
8578
- data: [
8579
- [0, null],
8580
- [2, null],
8581
- [3.5, null],
8582
- [4.9, null],
8583
- [5.9, null],
8584
- [6.9, null],
8585
- {
8586
- //延长线1
8587
- value: [10.4, yVal25 - (2.7 * (yVal25 - yVal1)) / 2.1],
8588
- symbol: 'none', //隐藏线条上的数据点
8589
- },
8590
- [11, yVal1], //第一个点
8591
- [11.8, null],
8592
- [13.1, yVal25], //第二个点
8593
- [14.6, yVal2], //第三个点
8594
- {
8595
- //延长线2
8596
- value: [15.2, (2.1 / 1.5) * (yVal2 - yVal25) + yVal25],
8597
- symbol: 'none', //隐藏线条上的数据点
8598
- },
8599
- [16.4, null],
8600
- [17.4, null],
8601
- [18.9, null],
8602
- [19.8, null],
8603
- [20.7, null],
8604
- [21.6, null],
8605
- [22.6, null],
8606
- ],
8607
- markPoint: {
8608
- data: [
8609
- {
8610
- xAxis: 13.1,
8611
- yAxis: yVal25,
8612
- symbolOffset: [40, 25],
8613
- label: {
8614
- show: true,
8615
- color: '#000',
8616
- formatter: function (data) {
8617
- //显示25这个坐标点数据
8618
- return isAllNull ? '' : '(' + 25 + ' , ' + data.data.yAxis + ')';
8619
- },
8620
- },
8621
- itemStyle: { color: 'transparent' },
8622
- },
8623
- ],
8624
- },
8625
- markLine: {
8626
- symbol: '', //取消箭头
8627
- silent: true, //取消鼠标hover事件
8628
- label: {
8629
- //标线的文本,模拟x轴显示的内容
8630
- position: 'start', //改变label位置
8631
- // rotate: 45, //设置文字旋转度数(注意:ECharts官网文档居然没有rotate这个属性的说明)
8632
- // backgroundColor:'#fff'
8633
- // color:'#f00',//文字颜色
8634
- formatter: (data) => {
8635
- return data.name;
8636
- },
8637
- },
8638
- lineStyle: { color: '#e0e6f1', type: 'solid' },
8639
- data: [
8640
- {
8641
- name: '5',
8642
- xAxis: 0,
8643
- label: {
8644
- fontSize: xyFontSize,
8645
- },
8646
- },
8647
- {
8648
- name: '6',
8649
- xAxis: 2,
8650
- label: {
8651
- fontSize: xyFontSize,
8652
- },
8653
- },
8654
- {
8655
- name: '7',
8656
- xAxis: 3.5,
8657
- label: {
8658
- fontSize: xyFontSize,
8659
- },
8660
- },
8661
- {
8662
- name: '8',
8663
- xAxis: 4.9,
8664
- label: {
8665
- fontSize: xyFontSize,
8666
- },
8667
- },
8668
- {
8669
- name: '9',
8670
- xAxis: 5.9,
8671
- label: {
8672
- fontSize: xyFontSize,
8673
- },
8674
- },
8675
- {
8676
- name: '10',
8677
- xAxis: 6.9,
8678
- label: {
8679
- fontSize: xyFontSize,
8680
- },
8681
- },
8682
- {
8683
- //延长线1
8684
- name: '',
8685
- xAxis: 10.4,
8686
- lineStyle: {
8687
- opacity: 0,
8688
- },
8689
- },
8690
- {
8691
- //第一个点
8692
- name: '',
8693
- xAxis: 11,
8694
- },
8695
- {
8696
- name: '20',
8697
- xAxis: 11.8,
8698
- label: {
8699
- fontSize: xyFontSize,
8700
- },
8701
- },
8702
- {
8703
- //第二个点
8704
- name: '25',
8705
- xAxis: 13.1,
8706
- label: {
8707
- fontSize: xyFontSize,
8708
- },
8709
- },
8710
- {
8711
- //第三个点
8712
- name: '30',
8713
- xAxis: 14.6,
8714
- label: {
8715
- fontSize: xyFontSize,
8716
- },
8717
- },
8718
- {
8719
- //延长线2
8720
- name: '',
8721
- xAxis: 15.2,
8722
- lineStyle: {
8723
- opacity: 0,
8724
- },
8725
- },
8726
- {
8727
- name: '40',
8728
- xAxis: 16.4,
8729
- label: {
8730
- fontSize: xyFontSize,
8731
- },
8732
- },
8733
- {
8734
- name: '50',
8735
- xAxis: 17.4,
8736
- label: {
8737
- fontSize: xyFontSize,
8738
- },
8739
- },
8740
- {
8741
- name: '',
8742
- xAxis: 18.9,
8743
- },
8744
- {
8745
- name: '',
8746
- xAxis: 19.8,
8747
- },
8748
- {
8749
- name: '',
8750
- xAxis: 20.7,
8751
- },
8752
- {
8753
- name: '',
8754
- xAxis: 21.6,
8755
- },
8756
- {
8757
- name: '100',
8758
- xAxis: 22.6,
8759
- label: {
8760
- fontSize: xyFontSize,
8761
- },
8762
- },
8763
- //横线
8764
- [
8765
- {
8766
- coord: [0, yVal25],
8767
- lineStyle: {
8768
- color: '#529b2e',
8769
- type: 'solid',
8770
- },
8771
- },
8772
- { coord: [13.1, yVal25] },
8773
- ],
8774
- //纵线
8775
- [
8776
- {
8777
- coord: [13.1, yAxisMin],
8778
- lineStyle: {
8779
- color: '#000',
8780
- type: 'silid',
8781
- },
8782
- },
8783
- { coord: [13.1, yVal25] },
8784
- ],
8785
- ],
8786
- },
8787
- },
8788
- ];
8789
- if (isAllNull) {
8790
- seriesObjs = [];
8791
- }
8588
+ if (fraction < 1.5)
8589
+ niceFraction = 1;
8590
+ else if (fraction < 3)
8591
+ niceFraction = 2;
8592
+ else if (fraction < 7)
8593
+ niceFraction = 5;
8594
+ else
8595
+ niceFraction = 10;
8596
+ }
8597
+ return niceFraction * Math.pow(10, exponent);
8598
+ }
8599
+ // 根据一组 y 值自动计算 yMin / yMax / interval
8600
+ function calcYBounds(values, marginRatio, targetTicks) {
8601
+ marginRatio = marginRatio === undefined ? 0.12 : marginRatio;
8602
+ targetTicks = targetTicks || 5;
8603
+ var dataMin = Math.min.apply(null, values);
8604
+ var dataMax = Math.max.apply(null, values);
8605
+ var range = dataMax - dataMin;
8606
+ if (range === 0) {
8607
+ range = Math.abs(dataMax) || 1;
8608
+ } // 防止所有值相同
8609
+ var margin = range * marginRatio; // 上下留白
8610
+ var rawMin = dataMin - margin;
8611
+ var rawMax = dataMax + margin;
8612
+ var interval = niceNum((rawMax - rawMin) / (targetTicks - 1));
8613
+ var yMin = Math.floor(rawMin / interval) * interval;
8614
+ var yMax = Math.ceil(rawMax / interval) * interval;
8615
+ // 消除浮点误差
8616
+ yMin = +yMin.toFixed(10);
8617
+ yMax = +yMax.toFixed(10);
8618
+ interval = +interval.toFixed(10);
8619
+ return { min: yMin, max: yMax, interval: interval };
8620
+ }
8621
+ // 把三个点 + 两端延长点一起纳入计算,确保整条线都显示得下
8622
+ var yBounds = calcYBounds([y1, y2, y3, extLY, extRY], 0.12, 5);
8623
+ var yMin = yBounds.min;
8624
+ var yMax = yBounds.max;
8625
+ var yInterval = yBounds.interval;
8626
+ /* ==========================================================
8627
+ 4. X 轴刻度定义
8628
+ ========================================================== */
8629
+ var allTicks = [5, 6, 7, 8, 9, 10, 20, 25, 30, 40, 50, 60, 70, 80, 90, 100, 150];
8630
+ var labeledTicks = [5, 6, 7, 8, 9, 10, 20, 25, 30, 40, 50, 100];
8631
+ var xMin = LOG(5), xMax = LOG(150);
8632
+ var vLines = allTicks.map(function (v) {
8633
+ return { xAxis: LOG(v) };
8634
+ });
8792
8635
  if (chartExtJson != null && chartExtJson != undefined && chartExtJson.yxdsyHsl != null && chartExtJson.yxdsyHsl != undefined) {
8793
8636
  // 默认输出精度
8794
8637
  let outJdYxdsyHsl = 0.1;
@@ -8798,103 +8641,163 @@ const EChartsUtilsAll = {
8798
8641
  if (chartExtJson.yxdsyHslJd != null && chartExtJson.yxdsyHslJd != undefined) {
8799
8642
  outJdYxdsyHsl = chartExtJson.yxdsyHslJd;
8800
8643
  }
8801
- outValYxdsyHsl = EChartsUtilsComm.getRound(yVal25, outJdYxdsyHsl);
8802
- sheet.setValue(chartExtJson.yxdsyHsl.row, chartExtJson.yxdsyHsl.col, outValYxdsyHsl);
8644
+ outValYxdsyHsl = EChartsUtilsComm.getRound(y2, outJdYxdsyHsl);
8645
+ sheet.setValue(chartExtJson.yxdsyHsl.row, chartExtJson.yxdsyHsl.col, typeof outValYxdsyHsl == 'string' && (outValYxdsyHsl + '').indexOf('NaN') != -1 ? '/' : outValYxdsyHsl);
8803
8646
  }
8804
- let option = {
8805
- grid: {
8806
- // show: true,//是否显示外边框线
8807
- // borderColor: '#f00',//外边框线颜色
8808
- top: 25,
8809
- left: 30,
8810
- right: 10,
8811
- bottom: 35,
8812
- containLabel: true,
8647
+ /* ==========================================================
8648
+ 5. 图表配置
8649
+ ========================================================== */
8650
+ var option = {
8651
+ /* --- 标题 --- */
8652
+ title: {
8653
+ text: title,
8654
+ left: 'center',
8655
+ top: 0,
8656
+ textStyle: { fontSize: 14, fontWeight: 'normal' },
8813
8657
  },
8814
- //提示框组件,参考文档:https://echarts.apache.org/zh/option.html#tooltip
8658
+ /* --- tooltip --- */
8815
8659
  tooltip: {
8816
- trigger: 'axis',
8817
- formatter: function (datas, ticket) {
8818
- return datas && datas[0].data.length > 1
8819
- ? datas[0].data[1] == null
8820
- ? ''
8821
- : datas[0].seriesName + '(' + datas[0].data[0] + ')' + ':' + datas[0].data[1]
8822
- : datas[0].data;
8660
+ trigger: 'item',
8661
+ formatter: function (params) {
8662
+ if (params.seriesType === 'scatter' && params.data && params.data.realX !== undefined) {
8663
+ return '(' + params.data.realX + ', ' + params.data.realY + ')';
8664
+ }
8665
+ return '';
8823
8666
  },
8667
+ backgroundColor: 'rgba(255,255,255,0.95)',
8668
+ borderColor: '#ccc',
8669
+ borderWidth: 1,
8670
+ textStyle: { color: '#333', fontSize: 13 },
8671
+ padding: [6, 10],
8824
8672
  },
8825
- //顶部的标题,参考文档:https://echarts.apache.org/zh/option.html#title
8826
- title: [
8673
+ grid: { left: 50, right: 10, top: 20, bottom: 0 },
8674
+ /* --- X 轴 --- */
8675
+ xAxis: {
8676
+ type: 'value',
8677
+ min: xMin,
8678
+ max: xMax,
8679
+ axisLine: { show: true },
8680
+ axisTick: { show: false },
8681
+ axisLabel: { show: false },
8682
+ splitLine: { show: false },
8683
+ name: xName,
8684
+ nameLocation: 'center',
8685
+ nameGap: 18,
8686
+ nameTextStyle: { fontSize: 12, color: '#333' },
8687
+ },
8688
+ /* --- Y 轴 --- */
8689
+ yAxis: {
8690
+ type: 'value',
8691
+ min: yMin,
8692
+ max: yMax,
8693
+ interval: yInterval,
8694
+ position: 'left',
8695
+ axisLine: { show: true, lineStyle: { color: '#333', width: 1.5 } },
8696
+ axisTick: { show: true, length: 5, lineStyle: { color: '#333' } },
8697
+ axisLabel: { show: true, fontSize: 12, color: '#333', margin: 10 },
8698
+ splitLine: { show: true, lineStyle: { color: '#e0e6f1', width: 1 } },
8699
+ name: yName,
8700
+ nameLocation: 'center',
8701
+ nameGap: 30,
8702
+ nameRotate: 90,
8703
+ nameTextStyle: { fontSize: 12, color: '#333' },
8704
+ },
8705
+ series: [
8706
+ /* --- ① 纵向灰色网格线 --- */
8827
8707
  {
8828
- show: true,
8829
- text: title,
8830
- left: 'center',
8831
- top: 0,
8832
- textStyle: {
8833
- fontSize: 14,
8834
- fontWeight: 'normal',
8708
+ type: 'line',
8709
+ data: [],
8710
+ silent: true,
8711
+ z: 1,
8712
+ markLine: {
8713
+ silent: true,
8714
+ symbol: 'none',
8715
+ lineStyle: { color: '#e0e6f1', width: 1, type: 'solid' },
8716
+ label: { show: false },
8717
+ data: vLines,
8835
8718
  },
8836
8719
  },
8720
+ /* --- ② 主直线(含两端延长) --- */
8837
8721
  {
8838
- show: true,
8839
- text: xName,
8840
- left: 'center',
8841
- bottom: 0,
8842
- textStyle: {
8843
- fontSize: 12,
8844
- fontWeight: 'normal',
8845
- },
8846
- },
8847
- ],
8848
- //图例,参考文档:https://echarts.apache.org/zh/option.html#legend
8849
- legend: {
8850
- show: false,
8851
- left: 'right',
8852
- data: [legendName],
8853
- selected: {
8854
- legendName: true, //显示
8722
+ type: 'line',
8723
+ z: 30,
8724
+ silent: true,
8725
+ data: [
8726
+ [extLX, extLY],
8727
+ [logX1, y1],
8728
+ [logX2, y2],
8729
+ [logX3, y3],
8730
+ [extRX, extRY],
8731
+ ],
8732
+ lineStyle: { color: '#409EFF', width: 2 },
8733
+ symbol: 'none',
8855
8734
  },
8856
- selectedMode: 'multiple', //用于控制图例的选择模式(single:单选、multiple:多选、false:禁止选择)
8857
- },
8858
- xAxis: {
8859
- type: 'value',
8860
- axisTick: { show: false }, //隐藏刻度线
8861
- axisLabel: { show: false }, //隐藏刻度值
8862
- //网格线,参考文档:https://echarts.apache.org/zh/option.html#xAxis.splitLine
8863
- splitLine: {
8864
- show: false, //隐藏分割线
8735
+ /* --- ③ a1 / a2 / a3 圆点(带 tooltip) --- */
8736
+ {
8737
+ type: 'scatter',
8738
+ z: 6,
8739
+ data: [
8740
+ { value: [logX1, y1], realX: x1, realY: y1, name: 'a1' },
8741
+ { value: [logX2, y2], realX: x2, realY: isNaN(y2) ? 0 : +y2.toFixed(2), name: 'a2' },
8742
+ { value: [logX3, y3], realX: x3, realY: y3, name: 'a3' },
8743
+ ],
8744
+ symbol: 'circle',
8745
+ symbolSize: 10,
8746
+ itemStyle: { color: '#409EFF', borderColor: '#fff', borderWidth: 1.5 },
8865
8747
  },
8866
- min: 0,
8867
- max: 23.5,
8868
- },
8869
- yAxis: [
8748
+ /* --- ④ a2 横向绿色线(从 y 轴到 a2)+ 文字标注 --- */
8870
8749
  {
8871
- type: 'value',
8872
- name: yName,
8873
- nameGap: !isAllNull ? 30 : 10,
8874
- nameRotate: 90,
8875
- nameLocation: 'middle',
8876
- splitLine: {
8877
- show: true,
8878
- lineStyle: {
8879
- color: '#e0e6f1', //'#e0e6f1',
8880
- type: 'solid',
8881
- },
8750
+ type: 'scatter',
8751
+ z: 4,
8752
+ silent: true,
8753
+ data: [],
8754
+ markLine: {
8755
+ silent: true,
8756
+ symbol: 'none',
8757
+ lineStyle: { color: '#2eaf4a', width: 2, type: 'solid' },
8758
+ label: { show: false },
8759
+ data: [[{ coord: [xMin, y2] }, { coord: [logX2, y2] }]],
8882
8760
  },
8883
- splitNumber: 4, //设置y轴分隔的段数,如0~100之间默认情况可能会按照0、20、40、60……的间隔显示,设置相应的数字后就会根据实际情况显示的更细,如0、10、20、30……
8884
- min: !isAllNull ? yAxisMin : null,
8885
- max: yAxisMax,
8886
- axisLabel: {
8887
- show: !isAllNull ? true : false,
8888
- fontSize: xyFontSize,
8761
+ markPoint: {
8762
+ silent: true,
8763
+ symbol: 'circle',
8764
+ symbolSize: 0,
8765
+ data: [{ coord: [logX2, y2] }],
8766
+ label: {
8767
+ show: true,
8768
+ formatter: '(' + x2 + ', ' + (isNaN(y2) ? 0 : y2.toFixed(2)) + ')',
8769
+ position: 'right',
8770
+ distance: 10,
8771
+ fontSize: 13,
8772
+ fontWeight: 'bold',
8773
+ color: '#2eaf4a',
8774
+ },
8889
8775
  },
8890
- axisTick: {
8891
- show: !isAllNull ? true : false,
8776
+ },
8777
+ /* --- ⑤ a2 纵向黑色线(从 x 轴到 a2) --- */
8778
+ {
8779
+ type: 'scatter',
8780
+ z: 4,
8781
+ silent: true,
8782
+ data: [],
8783
+ markLine: {
8784
+ silent: true,
8785
+ symbol: 'none',
8786
+ lineStyle: { color: '#000000', width: 2, type: 'solid' },
8787
+ label: { show: false },
8788
+ data: [[{ coord: [logX2, yMin] }, { coord: [logX2, y2] }]],
8892
8789
  },
8893
8790
  },
8894
8791
  ],
8895
- series: seriesObjs,
8896
8792
  };
8897
- return option;
8793
+ return {
8794
+ option: option,
8795
+ ext: {
8796
+ labeledTicks: labeledTicks,
8797
+ LOG: LOG,
8798
+ yMin: yMin,
8799
+ },
8800
+ };
8898
8801
  },
8899
8802
  /**
8900
8803
  * 土工合成材料(垂直渗透系数)
@@ -10645,7 +10548,7 @@ const EChartsUtils = {
10645
10548
  console.log('xDataArr:', xDataArr);
10646
10549
  console.log('yDataArr:', yDataArr);
10647
10550
  }
10648
- let option;
10551
+ let option, ext;
10649
10552
  if (config.chartType == 10) {
10650
10553
  option = EChartsUtilsAll.chart10(config, xDataArr, yDataArr, sheet);
10651
10554
  }
@@ -10719,7 +10622,9 @@ const EChartsUtils = {
10719
10622
  option = EChartsUtilsAll.chart330(config, xDataArr, yDataArr, sheet);
10720
10623
  }
10721
10624
  else if (config.chartType == 350) {
10722
- option = EChartsUtilsAll.chart350(config, xDataArr, yDataArr, sheet);
10625
+ const allOpts = EChartsUtilsAll.chart350(config, xDataArr, yDataArr, sheet);
10626
+ option = allOpts.option;
10627
+ ext = allOpts.ext;
10723
10628
  }
10724
10629
  else if (config.chartType == 370) {
10725
10630
  option = EChartsUtilsAll.chart370(config, xDataArr, yDataArr, sheet);
@@ -10754,6 +10659,34 @@ const EChartsUtils = {
10754
10659
  ecObj.setOption(option);
10755
10660
  }
10756
10661
  ecObj.setOption(option);
10662
+ if (config.chartType == 350) {
10663
+ /* ==========================================================
10664
+ 6. X 轴刻度文字(graphic 精确定位)
10665
+ ========================================================== */
10666
+ setTimeout(function () {
10667
+ var graphicList = [];
10668
+ ext.labeledTicks.forEach(function (tick) {
10669
+ var px = ecObj.convertToPixel({ gridIndex: 0 }, [ext.LOG(tick), ext.yMin]);
10670
+ if (!isNaN(px[1] + 12)) {
10671
+ graphicList.push({
10672
+ type: 'text',
10673
+ bottom: 20,
10674
+ x: px[0],
10675
+ y: px[1] + 12,
10676
+ style: {
10677
+ text: String(tick),
10678
+ fontSize: 12,
10679
+ fill: '#333',
10680
+ textAlign: 'center',
10681
+ textVerticalAlign: 'top',
10682
+ },
10683
+ silent: true,
10684
+ });
10685
+ }
10686
+ });
10687
+ ecObj.setOption({ graphic: graphicList });
10688
+ }, 120);
10689
+ }
10757
10690
  return ecObj;
10758
10691
  },
10759
10692
  /**