Skip to content

Can't use responsive attribute in options #266

@luckys383

Description

@luckys383

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.

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