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

Maxin with multiple chartData #231

Closed
shtse8 opened this issue Oct 20, 2017 · 5 comments
Closed

Maxin with multiple chartData #231

shtse8 opened this issue Oct 20, 2017 · 5 comments

Comments

@shtse8
Copy link

shtse8 commented Oct 20, 2017

I am using reactiveProp to update my chart when props are changed. But I don't know how to config for multiple chartData as my chart is multiple lines. Any help? Thanks.

@apertureless
Copy link
Owner

apertureless commented Oct 20, 2017

Can you show your code or provide a codepen ? You don't have to config anything. It should just work 😅

@elanvelazquez
Copy link

this is my vue file
Charts.zip

and this is my error:
image

how can i solve this?

@shtse8
Copy link
Author

shtse8 commented Oct 24, 2017

// MonthlyIncome.js
import { Line, mixins } from 'vue-chartjs'

export default {
  extends: Line,
  mixins: [mixins.reactiveProp],
  props: ['chartData', 'options'],
  mounted () {
    this.renderChart(this.chartData, this.options)
  }
}

Once this.chartData is mixed chartData as follow:

{
    datasets: [{
          label: 'Bar Dataset',
          data: [10, 20, 30, 40]
        }, {
          label: 'Line Dataset',
          data: [50, 50, 50, 50],

          // Changes this dataset to become a line
          type: 'line'
        }],
    labels: ['January', 'February', 'March', 'April']
  }

How can I config for this case?

@apertureless
Copy link
Owner

So you adding the type dynamically?

@shtse8
Copy link
Author

shtse8 commented Oct 29, 2017

I got the concept of chartData now. I need to put the whole object into the component instead of just the data.

@shtse8 shtse8 closed this as completed Oct 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants