rapid-spreadjs 1.0.189 → 1.0.191
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 +23 -13
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.esm.js +23 -13
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1637,7 +1637,10 @@ const BusinessUtils = {
|
|
|
1637
1637
|
}
|
|
1638
1638
|
if (!isShowBlankRow) {
|
|
1639
1639
|
// 设置行不可见
|
|
1640
|
-
if (!isEnable || createBlackRowIndex != -1) {
|
|
1640
|
+
// if (!isEnable || createBlackRowIndex != -1) {
|
|
1641
|
+
// sheet.setRowVisible(createBlackRowIndex, false);
|
|
1642
|
+
// }
|
|
1643
|
+
if (createBlackRowIndex != -1) {
|
|
1641
1644
|
sheet.setRowVisible(createBlackRowIndex, false);
|
|
1642
1645
|
}
|
|
1643
1646
|
return;
|
|
@@ -5350,13 +5353,13 @@ const EChartsUtilsAll = {
|
|
|
5350
5353
|
chart50: (config, xDataArr, yDataArr) => {
|
|
5351
5354
|
let lineData = JSON.parse(config.chartLinesJson);
|
|
5352
5355
|
let title = '', xName = config.chartXName, yName = config.chartYName;
|
|
5353
|
-
// 判断某个子数组的值是否全部为 "/"
|
|
5356
|
+
// 判断某个子数组的值是否全部为 "/"、null、空串或 0(即该条线无任何有效数据)
|
|
5354
5357
|
const isAllEmpty = (arr) => {
|
|
5355
5358
|
if (!Array.isArray(arr))
|
|
5356
5359
|
return true;
|
|
5357
5360
|
if (arr.length === 0)
|
|
5358
5361
|
return true;
|
|
5359
|
-
return arr.every((v) => v == null || v === '/' || v === '');
|
|
5362
|
+
return arr.every((v) => v == null || v === '/' || v === '' || v === 0);
|
|
5360
5363
|
};
|
|
5361
5364
|
// 同步过滤:将 yDataArr 中“值全为空”的子数组剔除,同时按索引对应剔除 lineData 中同一条线配置,
|
|
5362
5365
|
// 保证剩余的线其图例名/颜色与 y 数据一一对应
|
|
@@ -5408,8 +5411,11 @@ const EChartsUtilsAll = {
|
|
|
5408
5411
|
}
|
|
5409
5412
|
// 若任意一条线存在非空值,则按“所有线均非空”过滤出有效点;否则保留全部点(与 chart50 上限/下限过滤逻辑保持语义一致)
|
|
5410
5413
|
const hasAnyValid = nullCounts.some((cnt, i) => cnt < (filteredYDataArr[i] || []).length);
|
|
5414
|
+
// 过滤后的 x 原始值(与过滤后的 y 一一对应,避免 x/y 长度错位)
|
|
5415
|
+
const validXValues = [];
|
|
5411
5416
|
allData.forEach((item) => {
|
|
5412
5417
|
if (!hasAnyValid) {
|
|
5418
|
+
validXValues.push(item.x);
|
|
5413
5419
|
for (let i = 0; i < lineCount; i++) {
|
|
5414
5420
|
yDataSources[i].push(item['y' + i]);
|
|
5415
5421
|
}
|
|
@@ -5425,6 +5431,7 @@ const EChartsUtilsAll = {
|
|
|
5425
5431
|
}
|
|
5426
5432
|
}
|
|
5427
5433
|
if (allValid) {
|
|
5434
|
+
validXValues.push(item.x);
|
|
5428
5435
|
for (let i = 0; i < lineCount; i++) {
|
|
5429
5436
|
yDataSources[i].push(item['y' + i]);
|
|
5430
5437
|
}
|
|
@@ -5434,16 +5441,16 @@ const EChartsUtilsAll = {
|
|
|
5434
5441
|
let xData = [];
|
|
5435
5442
|
let markLineData = [];
|
|
5436
5443
|
// x和y轴的字体大小
|
|
5437
|
-
const
|
|
5438
|
-
// 组装 x 轴与 markLine
|
|
5439
|
-
|
|
5444
|
+
const xFontSize = 8, yFontSize = 10;
|
|
5445
|
+
// 组装 x 轴与 markLine(基于过滤后的 x,与 y 数据一一对应)
|
|
5446
|
+
validXValues.forEach((item, index) => {
|
|
5440
5447
|
const val045 = Number(EChartsUtilsComm.getRound(item ** 0.45, 0.001));
|
|
5441
5448
|
markLineData.push({
|
|
5442
5449
|
name: item + '',
|
|
5443
5450
|
xAxis: val045,
|
|
5444
5451
|
label: {
|
|
5445
|
-
show:
|
|
5446
|
-
fontSize:
|
|
5452
|
+
show: validXValues.length >= 6 && index % 2 != 0 && index < 6 ? false : true,
|
|
5453
|
+
fontSize: xFontSize,
|
|
5447
5454
|
},
|
|
5448
5455
|
});
|
|
5449
5456
|
xData.push(val045);
|
|
@@ -5467,7 +5474,7 @@ const EChartsUtilsAll = {
|
|
|
5467
5474
|
let obj = {
|
|
5468
5475
|
name: name,
|
|
5469
5476
|
type: 'line',
|
|
5470
|
-
smooth: true,
|
|
5477
|
+
// smooth: true,
|
|
5471
5478
|
symbol: symbol,
|
|
5472
5479
|
symbolSize: 5,
|
|
5473
5480
|
z: 10,
|
|
@@ -5484,6 +5491,9 @@ const EChartsUtilsAll = {
|
|
|
5484
5491
|
symbol: '',
|
|
5485
5492
|
silent: true,
|
|
5486
5493
|
label: {
|
|
5494
|
+
fontSize: 18,
|
|
5495
|
+
rotate: 45,
|
|
5496
|
+
padding: [8, 0, 0, 0],
|
|
5487
5497
|
position: 'start',
|
|
5488
5498
|
formatter: (data) => {
|
|
5489
5499
|
return data.name;
|
|
@@ -5569,7 +5579,7 @@ const EChartsUtilsAll = {
|
|
|
5569
5579
|
show: true,
|
|
5570
5580
|
text: xName,
|
|
5571
5581
|
left: 'center',
|
|
5572
|
-
bottom:
|
|
5582
|
+
bottom: -5,
|
|
5573
5583
|
textStyle: {
|
|
5574
5584
|
fontSize: 12,
|
|
5575
5585
|
fontWeight: 'normal',
|
|
@@ -5594,8 +5604,8 @@ const EChartsUtilsAll = {
|
|
|
5594
5604
|
// max: xData.length > 0 ? xData[xData.length - 1] + 0.1 : null,
|
|
5595
5605
|
min: xData.length > 0 ? (Math.min(...xData) > 0.2 ? Math.min(...xData) - 0.2 : 0) : null,
|
|
5596
5606
|
max: xData.length > 0 ? Math.max(...xData) + 0.2 : null,
|
|
5597
|
-
// 控制x轴是否为反方向,如果x轴录入的数据从左到右为从大到小的顺序,则开启反方向
|
|
5598
|
-
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
|
|
5599
5609
|
},
|
|
5600
5610
|
yAxis: [
|
|
5601
5611
|
{
|
|
@@ -5615,7 +5625,7 @@ const EChartsUtilsAll = {
|
|
|
5615
5625
|
max: 100,
|
|
5616
5626
|
splitNumber: 10,
|
|
5617
5627
|
axisLabel: {
|
|
5618
|
-
fontSize:
|
|
5628
|
+
fontSize: yFontSize,
|
|
5619
5629
|
},
|
|
5620
5630
|
},
|
|
5621
5631
|
],
|