我想读取 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) Hy伙计们,
有没有人在Vuejs应用程序中集成Openlayers的经验?
我需要在Vuejs应用程序上显示一些图层.
干杯,