Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: url or json or rows or columns is required. #4

Closed
wgmv opened this issue Oct 9, 2017 · 2 comments
Closed

Error: url or json or rows or columns is required. #4

wgmv opened this issue Oct 9, 2017 · 2 comments

Comments

@wgmv
Copy link

wgmv commented Oct 9, 2017

Hi I was just checking out vue-c3 and got this

[Vue warn]: Error in event handler for "init": "Error: url or json or rows or columns is required."

I just created an example chart like below and used it in the browser. Besides the console logs nothing shows. Should it work like this? Where could be the problem? Thanks!

<template>
    <div>
        <vue-c3 :handler="handler"></vue-c3>
    </div>
</template>

<script>
    import Vue from 'vue'
    import VueC3 from 'vue-c3'

    export default {
//        name: ...,

        components: {
            VueC3
        },

        data () {

            return {
                handler: new Vue()
            }
        },

        mounted () {
            // to init the graph call:
            const options = {
                columns: [
                    ['data1', 2, 4, 1, 5, 2, 1],
                    ['data2', 7, 2, 4, 6, 10, 1]
                ],

            }
            console.log('Mounted.');
            console.log(options.columns);
            this.handler.$emit('init', options)
        }
    }
</script>
@biering
Copy link
Owner

biering commented Oct 9, 2017

Hi, I made a small mistake in the documentation.
Just add a data Object around the columns array. I've updated the readme.

@biering biering closed this as completed Oct 9, 2017
@wgmv
Copy link
Author

wgmv commented Oct 9, 2017

Thanks! That was it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants