Skip to content

DonutChart not working inside a component #34

@Adurnam

Description

@Adurnam

Good afternoon,

I'm having an issue using the lib, specifically the DonutChart.

App.vue

<template>
  <div id="app">
        <img alt="Vue logo" src="./assets/logo.png">
    <DonutChart 
      id="donut" 
      :data="donutData" 
      colors='[ "#FF6384", "#36A2EB", "#FFCE56" ]' 
      resize="true">
    </DonutChart>
  </div>
</template>

<script>
import DonutChart from './components/DonutChart.vue'

export default {
  name: 'App',
  components: {
    DonutChart
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>

DonutChart.vue

<script>

import Vue from 'vue'
import { DonutChart } from 'vue-morris'

new Vue({
  el: '#app',

  data: {
    donutData: [
    { label: 'Red', value: 300 },
    { label: 'Blue', value: 50 },
    { label: 'Yellow', value: 100 }
    ],

    components: {
    DonutChart
    }
  }
});
</script>

<style>

</style>

Main.js

import Vue from 'vue'
import App from './App.vue'

import Raphael from 'raphael/raphael'
global.Raphael = Raphael

Vue.config.productionTip = false

new Vue({
  render: h => h(App),
}).$mount('#app')

I don't have any errors presently, juste a blank page. Do you have any thoughts on why?

Sincerely,
Mathieu.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions