zzz-pc-view 0.0.119 → 0.0.121

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zzz-pc-view",
3
- "version": "0.0.119",
3
+ "version": "0.0.121",
4
4
  "main": "src/index.umd.js",
5
5
  "module": "src/index.es.js",
6
6
  "types": "src/index.d.ts",
package/src/index.es.js CHANGED
@@ -2976,8 +2976,8 @@ const useChartStyleConfig = (param) => {
2976
2976
  // 设置图例的水平对齐位置或偏移量。如果传入的 param.legendLeft 有值,则使用该值;
2977
2977
  // 否则,使用默认值 'center',表示图例水平居中对齐。
2978
2978
  legendLeft: param.legendLeft ?? "center",
2979
- // 图例的宽度,如果未提供则使用默认值 0.8
2980
- legendWidth: param.legendWidth || 80 / 100,
2979
+ // 图例的宽度,如果未提供则使用默认值 80
2980
+ legendWidth: (param.legendWidth || 80) / 100,
2981
2981
  // 图例的字体大小,如果未提供则使用默认值 12
2982
2982
  legendFontSize: param.legendFontSize ?? 12,
2983
2983
  // 图例的字体族,如果未提供则使用默认的文本字体族
@@ -3263,51 +3263,62 @@ const setYAxis$1 = (chartOption, param) => {
3263
3263
  const axisName = dimension.axisName ?? "";
3264
3264
  if (!Object.prototype.hasOwnProperty.call(axisNameIndexMap, axisName)) {
3265
3265
  axisNameIndexMap[axisName] = yAxis.length;
3266
- yAxis.push({
3267
- // Y 轴名称
3268
- name: axisName,
3269
- // Y 轴名称的位置
3270
- nameLocation: yAxisNameLocation,
3271
- // Y 轴名称的文本样式
3272
- nameTextStyle: {
3273
- // 轴名称字体大小
3274
- fontSize: axisNameFontSize,
3275
- // 轴名称字体族
3276
- fontFamily: EN_TEXT_FONT_FAMILY
3277
- },
3278
- // Y 轴类型为数值轴
3279
- type: "value",
3280
- // 显示 Y
3281
- show: true,
3282
- // 是否启用缩放,继承自维度配置
3283
- scale: dimension.scale,
3284
- // Y 轴刻度配置
3285
- axisTick: {
3286
- // 显示刻度
3266
+ const minMax = {};
3267
+ const { min, max } = dimension;
3268
+ if (Number.isFinite(min)) {
3269
+ minMax.min = min;
3270
+ }
3271
+ if (Number.isFinite(max)) {
3272
+ minMax.max = max;
3273
+ }
3274
+ yAxis.push(
3275
+ Object.assign({
3276
+ // Y 轴名称
3277
+ name: axisName,
3278
+ // Y 轴名称的位置
3279
+ nameLocation: yAxisNameLocation,
3280
+ // Y 轴名称的文本样式
3281
+ nameTextStyle: {
3282
+ // 轴名称字体大小
3283
+ fontSize: axisNameFontSize,
3284
+ // 轴名称字体族
3285
+ fontFamily: EN_TEXT_FONT_FAMILY
3286
+ },
3287
+ // Y 轴类型为数值轴
3288
+ type: "value",
3289
+ // 显示 Y 轴
3287
3290
  show: true,
3288
- // 刻度与标签对齐
3289
- alignWithLabel: true
3290
- },
3291
- // Y 轴轴线配置
3292
- axisLine: {
3293
- // 显示轴线
3294
- show: true
3295
- },
3296
- // Y 轴标签配置
3297
- axisLabel: {
3298
- // 标签字体大小
3299
- fontSize: axisFontSize,
3300
- // 标签字体族,若未提供则使用默认字体族
3301
- fontFamily: dimension.labelFontFamily || NUMBER_FONT_FAMILY,
3302
- // 标签格式化函数,若未提供则使用默认数字格式化函数
3303
- formatter: dimension.labelFormatter || numberFormatter
3304
- },
3305
- // Y 轴分割线配置
3306
- splitLine: {
3307
- // 不显示分割线
3308
- show: false
3309
- }
3310
- });
3291
+ // 是否启用缩放,继承自维度配置
3292
+ scale: dimension.scale,
3293
+ // Y 轴刻度配置
3294
+ axisTick: {
3295
+ // 显示刻度
3296
+ show: true,
3297
+ // 刻度与标签对齐
3298
+ alignWithLabel: true
3299
+ },
3300
+ // Y 轴轴线配置
3301
+ axisLine: {
3302
+ // 显示轴线
3303
+ show: true
3304
+ },
3305
+ // Y 轴标签配置
3306
+ axisLabel: {
3307
+ // 标签字体大小
3308
+ fontSize: axisFontSize,
3309
+ // 标签字体族,若未提供则使用默认字体族
3310
+ fontFamily: dimension.labelFontFamily || NUMBER_FONT_FAMILY,
3311
+ // 标签格式化函数,若未提供则使用默认数字格式化函数
3312
+ formatter: dimension.labelFormatter || numberFormatter
3313
+ },
3314
+ // Y 轴分割线配置
3315
+ splitLine: {
3316
+ // 不显示分割线
3317
+ show: false
3318
+ }
3319
+ }),
3320
+ minMax
3321
+ );
3311
3322
  }
3312
3323
  const yAxisIndex = axisNameIndexMap[axisName];
3313
3324
  const dimensionId = dimension.id;