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

how to use Multi Axis Line Chart #19

Open
fish-and-skiing-life opened this issue Aug 7, 2021 · 0 comments
Open

how to use Multi Axis Line Chart #19

fish-and-skiing-life opened this issue Aug 7, 2021 · 0 comments

Comments

@fish-and-skiing-life
Copy link

I would like to have multiple y-labels for the line graph, as shown in the linked page.
so, I followed the official chartjs documentation and specified the options. The code looks like the following.

<template>
    <CChartLine
        :options='lineOptions'
        :datasets="lineData"
        :labels='lineLabels'
     />
</template>
<script>
export default {
    data() {
        return {
            lineData: [
                {
                    label: 'data1',
                    fill: false,
                    borderColor: 'rgb(65,105,225,0.9)',
                    data: [1,2,3,4],
                    radius: 3,
                    yAxisID: 'y'
                },
                {
                    label: 'data2',
                    fill: false,
                    borderColor: 'rgb(60,179,113,0.9)',
                    data: [1000000,2000000,3000000,4000000],
                    radius: 3,
                    yAxisID: 'y1'
                }
            ],
            lineOptions: {
                scales: {
                    y: {
                        type: 'linear',
                        display: true,
                        position: 'left',
                    },
                    y1: {
                        type: 'linear',
                        display: true,
                        position: 'right',
                    },
                }
            }
        }
    }
}
</script>

However, the following error occurred on the console.
Screen Shot 2021-08-07 at 16 30 25

How can I specify the options to resolve the error?

PS
I have changed the format of the options as listed in the issue #18 , but the same error occurs and it did not work.

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

1 participant