小编Wes*_*ey 的帖子

在vuejs Chartjs上显示json数据

我想读取 json 文件并使用 VueJs 在 Chartjs 上绘制数据。

我能够显示一些数据,但不能显示 Json 文件中的数据。

到目前为止,我的 vue.app 看起来像这样:

export default {
  name: 'app',
  data () {
    return {
      labelschart: [],
      datachart: [],
      testLabels: ['10/01/2017 02:25:34', '11/01/2017 02:25:34', '12/01/2017 02:25:34', '13/01/2017 02:25:34', '14/01/2017 02:25:34'],
      testData: [93.5, 93.4, 93.3, 93.4, 93.5]
Run Code Online (Sandbox Code Playgroud)

...

computed: {
    lineData () {
      return {
        labels: this.testLabels,
        datasets: [
          {
            label: 'Instrument',
            backgroundColor: '#36A2EB',
            data: this.testData,
            fill: 'False',
            borderColor: 'blue'
          }
        ]
      }
    }
Run Code Online (Sandbox Code Playgroud)

我的 linechart.vue 是这样的:

<script>
import { Line, mixins } …
Run Code Online (Sandbox Code Playgroud)

javascript vue.js chart.js vuejs2

5
推荐指数
0
解决办法
1072
查看次数

在vuejs应用程序中集成openlayers

Hy伙计们,

有没有人在Vuejs应用程序中集成Openlayers的经验?

我需要在Vuejs应用程序上显示一些图层.

干杯,

openlayers openlayers-3 vue.js

5
推荐指数
1
解决办法
4662
查看次数

标签 统计

vue.js ×2

chart.js ×1

javascript ×1

openlayers ×1

openlayers-3 ×1

vuejs2 ×1