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.esm.js
CHANGED
|
@@ -1615,7 +1615,10 @@ const BusinessUtils = {
|
|
|
1615
1615
|
}
|
|
1616
1616
|
if (!isShowBlankRow) {
|
|
1617
1617
|
// 设置行不可见
|
|
1618
|
-
if (!isEnable || createBlackRowIndex != -1) {
|
|
1618
|
+
// if (!isEnable || createBlackRowIndex != -1) {
|
|
1619
|
+
// sheet.setRowVisible(createBlackRowIndex, false);
|
|
1620
|
+
// }
|
|
1621
|
+
if (createBlackRowIndex != -1) {
|
|
1619
1622
|
sheet.setRowVisible(createBlackRowIndex, false);
|
|
1620
1623
|
}
|
|
1621
1624
|
return;
|
|
@@ -5328,13 +5331,13 @@ const EChartsUtilsAll = {
|
|
|
5328
5331
|
chart50: (config, xDataArr, yDataArr) => {
|
|
5329
5332
|
let lineData = JSON.parse(config.chartLinesJson);
|
|
5330
5333
|
let title = '', xName = config.chartXName, yName = config.chartYName;
|
|
5331
|
-
// 判断某个子数组的值是否全部为 "/"
|
|
5334
|
+
// 判断某个子数组的值是否全部为 "/"、null、空串或 0(即该条线无任何有效数据)
|
|
5332
5335
|
const isAllEmpty = (arr) => {
|
|
5333
5336
|
if (!Array.isArray(arr))
|
|
5334
5337
|
return true;
|
|
5335
5338
|
if (arr.length === 0)
|
|
5336
5339
|
return true;
|
|
5337
|
-
return arr.every((v) => v == null || v === '/' || v === '');
|
|
5340
|
+
return arr.every((v) => v == null || v === '/' || v === '' || v === 0);
|
|
5338
5341
|
};
|
|
5339
5342
|
// 同步过滤:将 yDataArr 中“值全为空”的子数组剔除,同时按索引对应剔除 lineData 中同一条线配置,
|
|
5340
5343
|
// 保证剩余的线其图例名/颜色与 y 数据一一对应
|
|
@@ -5386,8 +5389,11 @@ const EChartsUtilsAll = {
|
|
|
5386
5389
|
}
|
|
5387
5390
|
// 若任意一条线存在非空值,则按“所有线均非空”过滤出有效点;否则保留全部点(与 chart50 上限/下限过滤逻辑保持语义一致)
|
|
5388
5391
|
const hasAnyValid = nullCounts.some((cnt, i) => cnt < (filteredYDataArr[i] || []).length);
|
|
5392
|
+
// 过滤后的 x 原始值(与过滤后的 y 一一对应,避免 x/y 长度错位)
|
|
5393
|
+
const validXValues = [];
|
|
5389
5394
|
allData.forEach((item) => {
|
|
5390
5395
|
if (!hasAnyValid) {
|
|
5396
|
+
validXValues.push(item.x);
|
|
5391
5397
|
for (let i = 0; i < lineCount; i++) {
|
|
5392
5398
|
yDataSources[i].push(item['y' + i]);
|
|
5393
5399
|
}
|
|
@@ -5403,6 +5409,7 @@ const EChartsUtilsAll = {
|
|
|
5403
5409
|
}
|
|
5404
5410
|
}
|
|
5405
5411
|
if (allValid) {
|
|
5412
|
+
validXValues.push(item.x);
|
|
5406
5413
|
for (let i = 0; i < lineCount; i++) {
|
|
5407
5414
|
yDataSources[i].push(item['y' + i]);
|
|
5408
5415
|
}
|
|
@@ -5412,16 +5419,16 @@ const EChartsUtilsAll = {
|
|
|
5412
5419
|
let xData = [];
|
|
5413
5420
|
let markLineData = [];
|
|
5414
5421
|
// x和y轴的字体大小
|
|
5415
|
-
const
|
|
5416
|
-
// 组装 x 轴与 markLine
|
|
5417
|
-
|
|
5422
|
+
const xFontSize = 8, yFontSize = 10;
|
|
5423
|
+
// 组装 x 轴与 markLine(基于过滤后的 x,与 y 数据一一对应)
|
|
5424
|
+
validXValues.forEach((item, index) => {
|
|
5418
5425
|
const val045 = Number(EChartsUtilsComm.getRound(item ** 0.45, 0.001));
|
|
5419
5426
|
markLineData.push({
|
|
5420
5427
|
name: item + '',
|
|
5421
5428
|
xAxis: val045,
|
|
5422
5429
|
label: {
|
|
5423
|
-
show:
|
|
5424
|
-
fontSize:
|
|
5430
|
+
show: validXValues.length >= 6 && index % 2 != 0 && index < 6 ? false : true,
|
|
5431
|
+
fontSize: xFontSize,
|
|
5425
5432
|
},
|
|
5426
5433
|
});
|
|
5427
5434
|
xData.push(val045);
|
|
@@ -5445,7 +5452,7 @@ const EChartsUtilsAll = {
|
|
|
5445
5452
|
let obj = {
|
|
5446
5453
|
name: name,
|
|
5447
5454
|
type: 'line',
|
|
5448
|
-
smooth: true,
|
|
5455
|
+
// smooth: true,
|
|
5449
5456
|
symbol: symbol,
|
|
5450
5457
|
symbolSize: 5,
|
|
5451
5458
|
z: 10,
|
|
@@ -5462,6 +5469,9 @@ const EChartsUtilsAll = {
|
|
|
5462
5469
|
symbol: '',
|
|
5463
5470
|
silent: true,
|
|
5464
5471
|
label: {
|
|
5472
|
+
fontSize: 18,
|
|
5473
|
+
rotate: 45,
|
|
5474
|
+
padding: [8, 0, 0, 0],
|
|
5465
5475
|
position: 'start',
|
|
5466
5476
|
formatter: (data) => {
|
|
5467
5477
|
return data.name;
|
|
@@ -5547,7 +5557,7 @@ const EChartsUtilsAll = {
|
|
|
5547
5557
|
show: true,
|
|
5548
5558
|
text: xName,
|
|
5549
5559
|
left: 'center',
|
|
5550
|
-
bottom:
|
|
5560
|
+
bottom: -5,
|
|
5551
5561
|
textStyle: {
|
|
5552
5562
|
fontSize: 12,
|
|
5553
5563
|
fontWeight: 'normal',
|
|
@@ -5572,8 +5582,8 @@ const EChartsUtilsAll = {
|
|
|
5572
5582
|
// max: xData.length > 0 ? xData[xData.length - 1] + 0.1 : null,
|
|
5573
5583
|
min: xData.length > 0 ? (Math.min(...xData) > 0.2 ? Math.min(...xData) - 0.2 : 0) : null,
|
|
5574
5584
|
max: xData.length > 0 ? Math.max(...xData) + 0.2 : null,
|
|
5575
|
-
// 控制x轴是否为反方向,如果x轴录入的数据从左到右为从大到小的顺序,则开启反方向
|
|
5576
|
-
inverse: xData.length > 0 ? (xData[0] > xData[xData.length - 1] ? true : false) : false
|
|
5585
|
+
// // 控制x轴是否为反方向,如果x轴录入的数据从左到右为从大到小的顺序,则开启反方向
|
|
5586
|
+
// inverse: xData.length > 0 ? (xData[0] > xData[xData.length - 1] ? true : false) : false
|
|
5577
5587
|
},
|
|
5578
5588
|
yAxis: [
|
|
5579
5589
|
{
|
|
@@ -5593,7 +5603,7 @@ const EChartsUtilsAll = {
|
|
|
5593
5603
|
max: 100,
|
|
5594
5604
|
splitNumber: 10,
|
|
5595
5605
|
axisLabel: {
|
|
5596
|
-
fontSize:
|
|
5606
|
+
fontSize: yFontSize,
|
|
5597
5607
|
},
|
|
5598
5608
|
},
|
|
5599
5609
|
],
|