rapid-spreadjs 1.0.190 → 1.0.192

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
@@ -1325,7 +1325,7 @@ const BusinessUtils = {
1325
1325
  .indicatorSize(commentSize)
1326
1326
  .fontSize('10pt')
1327
1327
  .width(250)
1328
- .height(Math.ceil(item.tipMsg.length / 20) * 30);
1328
+ .height(Math.ceil(item.tipMsg.length / 20) * 40);
1329
1329
  if (commentDefaultTextIsSet) {
1330
1330
  sheet.setValue(item.row, item.col, commentDefaultText);
1331
1331
  }
@@ -1402,7 +1402,7 @@ const BusinessUtils = {
1402
1402
  .indicatorSize(commentSize)
1403
1403
  .fontSize('10pt')
1404
1404
  .width(250)
1405
- .height(Math.ceil(item.tipMsg.length / 20) * 30);
1405
+ .height(Math.ceil(item.tipMsg.length / 20) * 40);
1406
1406
  if (commentDefaultTextIsSet) {
1407
1407
  sheet.setValue(item.row, item.col, commentDefaultText);
1408
1408
  }
@@ -5353,13 +5353,13 @@ const EChartsUtilsAll = {
5353
5353
  chart50: (config, xDataArr, yDataArr) => {
5354
5354
  let lineData = JSON.parse(config.chartLinesJson);
5355
5355
  let title = '', xName = config.chartXName, yName = config.chartYName;
5356
- // 判断某个子数组的值是否全部为 "/" 或 null(即该条线无任何有效数据)
5356
+ // 判断某个子数组的值是否全部为 "/"、null、空串或 0(即该条线无任何有效数据)
5357
5357
  const isAllEmpty = (arr) => {
5358
5358
  if (!Array.isArray(arr))
5359
5359
  return true;
5360
5360
  if (arr.length === 0)
5361
5361
  return true;
5362
- return arr.every((v) => v == null || v === '/' || v === '');
5362
+ return arr.every((v) => v == null || v === '/' || v === '' || v === 0);
5363
5363
  };
5364
5364
  // 同步过滤:将 yDataArr 中“值全为空”的子数组剔除,同时按索引对应剔除 lineData 中同一条线配置,
5365
5365
  // 保证剩余的线其图例名/颜色与 y 数据一一对应
@@ -5411,8 +5411,11 @@ const EChartsUtilsAll = {
5411
5411
  }
5412
5412
  // 若任意一条线存在非空值,则按“所有线均非空”过滤出有效点;否则保留全部点(与 chart50 上限/下限过滤逻辑保持语义一致)
5413
5413
  const hasAnyValid = nullCounts.some((cnt, i) => cnt < (filteredYDataArr[i] || []).length);
5414
+ // 过滤后的 x 原始值(与过滤后的 y 一一对应,避免 x/y 长度错位)
5415
+ const validXValues = [];
5414
5416
  allData.forEach((item) => {
5415
5417
  if (!hasAnyValid) {
5418
+ validXValues.push(item.x);
5416
5419
  for (let i = 0; i < lineCount; i++) {
5417
5420
  yDataSources[i].push(item['y' + i]);
5418
5421
  }
@@ -5428,6 +5431,7 @@ const EChartsUtilsAll = {
5428
5431
  }
5429
5432
  }
5430
5433
  if (allValid) {
5434
+ validXValues.push(item.x);
5431
5435
  for (let i = 0; i < lineCount; i++) {
5432
5436
  yDataSources[i].push(item['y' + i]);
5433
5437
  }
@@ -5437,16 +5441,16 @@ const EChartsUtilsAll = {
5437
5441
  let xData = [];
5438
5442
  let markLineData = [];
5439
5443
  // x和y轴的字体大小
5440
- const xyFontSize = 10;
5441
- // 组装 x 轴与 markLine(所有线共用同一套 x 值)
5442
- xDataSourceOld.forEach((item, index) => {
5444
+ const xFontSize = 8, yFontSize = 10;
5445
+ // 组装 x 轴与 markLine(基于过滤后的 x,与 y 数据一一对应)
5446
+ validXValues.forEach((item, index) => {
5443
5447
  const val045 = Number(EChartsUtilsComm.getRound(item ** 0.45, 0.001));
5444
5448
  markLineData.push({
5445
5449
  name: item + '',
5446
5450
  xAxis: val045,
5447
5451
  label: {
5448
- show: xDataSourceOld.length >= 6 && index % 2 != 0 && index < 6 ? false : true,
5449
- fontSize: xyFontSize,
5452
+ show: validXValues.length >= 6 && index % 2 != 0 && index < 6 ? false : true,
5453
+ fontSize: xFontSize,
5450
5454
  },
5451
5455
  });
5452
5456
  xData.push(val045);
@@ -5470,7 +5474,7 @@ const EChartsUtilsAll = {
5470
5474
  let obj = {
5471
5475
  name: name,
5472
5476
  type: 'line',
5473
- smooth: true,
5477
+ // smooth: true,
5474
5478
  symbol: symbol,
5475
5479
  symbolSize: 5,
5476
5480
  z: 10,
@@ -5487,6 +5491,9 @@ const EChartsUtilsAll = {
5487
5491
  symbol: '',
5488
5492
  silent: true,
5489
5493
  label: {
5494
+ fontSize: 18,
5495
+ rotate: 45,
5496
+ padding: [8, 0, 0, 0],
5490
5497
  position: 'start',
5491
5498
  formatter: (data) => {
5492
5499
  return data.name;
@@ -5572,7 +5579,7 @@ const EChartsUtilsAll = {
5572
5579
  show: true,
5573
5580
  text: xName,
5574
5581
  left: 'center',
5575
- bottom: 0,
5582
+ bottom: -5,
5576
5583
  textStyle: {
5577
5584
  fontSize: 12,
5578
5585
  fontWeight: 'normal',
@@ -5597,8 +5604,8 @@ const EChartsUtilsAll = {
5597
5604
  // max: xData.length > 0 ? xData[xData.length - 1] + 0.1 : null,
5598
5605
  min: xData.length > 0 ? (Math.min(...xData) > 0.2 ? Math.min(...xData) - 0.2 : 0) : null,
5599
5606
  max: xData.length > 0 ? Math.max(...xData) + 0.2 : null,
5600
- // 控制x轴是否为反方向,如果x轴录入的数据从左到右为从大到小的顺序,则开启反方向
5601
- inverse: xData.length > 0 ? (xData[0] > xData[xData.length - 1] ? true : false) : false,
5607
+ // // 控制x轴是否为反方向,如果x轴录入的数据从左到右为从大到小的顺序,则开启反方向
5608
+ // inverse: xData.length > 0 ? (xData[0] > xData[xData.length - 1] ? true : false) : false
5602
5609
  },
5603
5610
  yAxis: [
5604
5611
  {
@@ -5618,7 +5625,7 @@ const EChartsUtilsAll = {
5618
5625
  max: 100,
5619
5626
  splitNumber: 10,
5620
5627
  axisLabel: {
5621
- fontSize: xyFontSize,
5628
+ fontSize: yFontSize,
5622
5629
  },
5623
5630
  },
5624
5631
  ],