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

Can't use responsive attribute in options #266

Open
luckys383 opened this issue Jun 27, 2018 · 0 comments
Open

Can't use responsive attribute in options #266

luckys383 opened this issue Jun 27, 2018 · 0 comments

Comments

@luckys383
Copy link

Hi,
I'm using this package in my application and everything is working fine. But Now when I want to use responsive option to set rules for responsiveness then this plugin is not allowing me to add that option.

Here is my code

let chartOptions = {
            chart: {
                plotBackgroundColor: null,
                plotBorderWidth: null,
                plotShadow: false,
                type: 'pie'
              },
              title: {
                text: this.getChartTitle()
              },
            plotOptions: {
                pie: {
                    allowPointSelect: true,
                    cursor: 'pointer',
                    dataLabels: {
                        enabled: true
                    },
                    showInLegend: true
                }
            },
            legend: {
                layout: 'vertical',
                align: 'right',
                verticalAlign: 'top'
            },
            series: [{
                name: seriseName,
                data: this.reportData.result
            }],
            responsive: {
                rules: [{
                    condition: {
                        maxWidth: 500
                    },
                    chartOptions: {
                        legend: {
                            align: 'center',
                            verticalAlign: 'bottom',
                            layout: 'horizontal'
                        }
                    }
                }]
            }
      };

this.chart = new Chart(chartOptions);

Please let me know if i'm doing anything wrong. Because I did same with highchart with jQuery and this is working fine..

Thanks.

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