简体   繁体   English

如何在Vue-Google-Charts中获取仪表图以工作-替代方法?

[英]How to get gauge chart in vue-google-charts to work - alternatives?

In my vue project, I want to display the NPS score in the form of a gauge chart. 在我的Vue项目中,我想以量表的形式显示NPS分数。 The easiest way was to use vue-google-charts. 最简单的方法是使用vue-google-charts。 Unfortunately, it seems like this type is not implemented. 不幸的是,似乎没有实现这种类型。

vue-google-charts are working on my project. vue-google-charts正在处理我的项目。 If I stick with the "ColumnChart". 如果我坚持使用“ ColumnChart”。 When I try to use the gauge chart nothing is displayed and I get an error in the console. 当我尝试使用压力表时,什么都没有显示,并且在控制台中出现错误。

      type="Gauge"
      :packages="packages"
      :data="chartData"
      :options="chartOptions"
    />    

as well as: 以及:

      type="gauge"
      :data="chartData"
      :options="chartOptions"
    />    

are not working. 不工作。

Any help is appreciated. 任何帮助表示赞赏。 If someone has a working example of how to use the google API directly I would do that. 如果有人知道如何直接使用google API的有效示例,我会这样做。 But I was not able to get that approach to work. 但是我无法采用这种方法。

The right way of doing it was by mixing upper and lower case. 正确的做法是混合大小写。

<GChart
:settings="{ packages: ['corechart', 'gauge'] }"
type="Gauge"
:data="raiting.NPS"
:options="chartOptions"
/>

Thank you very much @WhiteHat. 非常感谢@WhiteHat。 I tried it before, but only since you pointed me, that it is the right way, I tried the mix of upper and lower case. 我之前曾尝试过,但只有在您指出我这一点才对,所以我尝试了大小写混合。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM