You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Power BI自定义R HTML视觉中如何给numeric输入设置min、max约束

Power BI自定义R HTML视觉数值输入取值约束实现方法
  • 第一步:修改capabilities.json配置
    在你已有的TestNumeric配置结构中,在type字段的同级位置新增min、max属性即可设置取值上下限,同时可以配置defaultValue设置默认值,参考示例如下:
"TestNumeric": {
  "displayName": "Number",
  "description": "test number",
  "type": {
    "numeric": true
  },
  "min": 0,
  "max": 100,
  "defaultValue": 50
}

如果需要限制仅允许输入整数,可在type下新增"integer": true即可:

"type": {
  "numeric": true,
  "integer": true
}
  • 第二步:同步更新src/settings.ts配置
    对应调整settings.ts中该字段的类型定义和默认值,保证和capabilities.json的配置保持一致即可,示例如下:
export class VisualSettings extends DataViewObjectsParser {
  public TestNumeric: number = 50;
}

配置完成后重新打包视觉,数值输入项的取值约束就会生效,用户输入超出范围的数值时会自动被限制在你设置的区间内。

内容的提问来源于stack exchange,提问作者Stéphane Laurent

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.07 04:51:01