我正在尝试基于github上的microsoft教程为power BI创建一个可视化条形图 . 我完全遵循了他们的环境设置步骤,并试图用静态数据创建视觉,这是第一步 . 但是当我给出“pbiviz start”命令时,会导致错误:TYPESCRIPT / visualplugin.ts:(8,151)error类型'typeof barchart'上不存在属性visual
我是打字稿和d3的新手 . 有人可以帮忙吗?
由于您已将类 Visual 的名称更改为 BarChart 您需要将 "visualClassName" 属性的值更改为您的类名称,在 pbiviz.json 文件中为 BarChart . 看到链接:http://www.dutchdatadude.com/power-bi-custom-visual-development-tip-visualplugin-ts-property-visual-does-not-exist-error/
Visual
BarChart
"visualClassName"
pbiviz.json
此外,您还必须在 tsconfig.json 文件中的 "files" 属性数组中更改文件名 .
tsconfig.json
"files"
这很可能是 pbiviz 的API版本冲突 .
pbiviz
请注意,您引用的Github repo使用v1.5.0,运行 pbiviz update 时需要指定版本号:
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
UPDATE:
我想我已经从提示中发现了这个错误: typeof barchart .
typeof barchart
JavaScript标识符为case-sensitive . 因此,请确保您遵循Github仓库中使用的案例,例如: BarChart ,而不是 barchart . (或者不管它是什么)
barchart
2 回答
由于您已将类
Visual
的名称更改为BarChart
您需要将"visualClassName"
属性的值更改为您的类名称,在pbiviz.json
文件中为BarChart
. 看到链接:http://www.dutchdatadude.com/power-bi-custom-visual-development-tip-visualplugin-ts-property-visual-does-not-exist-error/此外,您还必须在
tsconfig.json
文件中的"files"
属性数组中更改文件名 .这很可能是
pbiviz
的API版本冲突 .请注意,您引用的Github repo使用v1.5.0,运行
pbiviz update
时需要指定版本号:阅读更多:Microsoft/PowerBI-visuals
UPDATE:
我想我已经从提示中发现了这个错误:
typeof barchart
.JavaScript标识符为case-sensitive . 因此,请确保您遵循Github仓库中使用的案例,例如:
BarChart
,而不是barchart
. (或者不管它是什么)