创建 Power BI 自定义视觉对象时出错 "Property visual does not exist on type 'typeof barchart'"
error "Property visual does not exist on type 'typeof barchart'" while creating power BI custom visual
我正在尝试根据 github 上的 Microsoft 教程为 Power BI 创建条形图视觉对象。我完全遵循了他们的环境设置步骤,并尝试使用静态数据创建视觉效果,这是第一步。
但是当我给出 "pbiviz start" 命令时,它会导致错误:
TYPESCRIPT/visualplugin.ts : (8,151) 错误 属性 视觉对象在类型 'typeof barchart'
上不存在
我是打字稿和 d3 的新手。有人可以帮忙吗?
很可能是 pbiviz
的 API 版本冲突。
请注意,您引用的 Github repo 使用的是 v1.5.0,您需要在 运行 pbiviz update
:
时指定版本号
#Update your version of pbiviz
npm install -g powerbi-visuals-tools
#Run update from the root of your visual project (where pbiviz.json is located)
pbiviz update 1.5.0
阅读更多信息:Microsoft/PowerBI-visuals
更新:
我想我已经从提示中发现了错误:typeof barchart
。
JavaScript 标识符是 case-sensitive。因此,请确保您遵循 Github 存储库中使用的案例,例如BarChart
,而不是 barchart
。 (或者不管它是什么)
由于您已将 class Visual
的名称更改为 BarChart
您需要将 "visualClassName"
属性 的值更改为您的 class 名称,在您的情况下是 pbiviz.json
文件中的 BarChart
。
请参阅 link :
http://www.dutchdatadude.com/power-bi-custom-visual-development-tip-visualplugin-ts-property-visual-does-not-exist-error/
此外,您还必须更改 tsconfig.json
文件中 "files"
属性 数组中的文件名。
我正在尝试根据 github 上的 Microsoft 教程为 Power BI 创建条形图视觉对象。我完全遵循了他们的环境设置步骤,并尝试使用静态数据创建视觉效果,这是第一步。 但是当我给出 "pbiviz start" 命令时,它会导致错误: TYPESCRIPT/visualplugin.ts : (8,151) 错误 属性 视觉对象在类型 'typeof barchart'
上不存在我是打字稿和 d3 的新手。有人可以帮忙吗?
很可能是 pbiviz
的 API 版本冲突。
请注意,您引用的 Github repo 使用的是 v1.5.0,您需要在 运行 pbiviz update
:
#Update your version of pbiviz
npm install -g powerbi-visuals-tools
#Run update from the root of your visual project (where pbiviz.json is located)
pbiviz update 1.5.0
阅读更多信息:Microsoft/PowerBI-visuals
更新:
我想我已经从提示中发现了错误:typeof barchart
。
JavaScript 标识符是 case-sensitive。因此,请确保您遵循 Github 存储库中使用的案例,例如BarChart
,而不是 barchart
。 (或者不管它是什么)
由于您已将 class Visual
的名称更改为 BarChart
您需要将 "visualClassName"
属性 的值更改为您的 class 名称,在您的情况下是 pbiviz.json
文件中的 BarChart
。
请参阅 link :
http://www.dutchdatadude.com/power-bi-custom-visual-development-tip-visualplugin-ts-property-visual-does-not-exist-error/
此外,您还必须更改 tsconfig.json
文件中 "files"
属性 数组中的文件名。