Hello,

I need to create a reusable element for a pie-chart. After trying I noticed 
that the charts are deformed. 

This is the polymer element I am using.

<link rel="import" href="../bower_components/polymer/polymer.html">

<polymer-element name="chart-pie">
    <template>
        <div id="container" style="min-width: 100%; height: 360px;"></div>
    </template>
    <script>
        Polymer("chart-pie", {
            url: "",
            datum: [
                            ['Low', 45.0],
                            ['Medium', 26.8],
                            {
                                name: 'High',
                                y: 12.8,
                                sliced: true,
                                selected: true
                            }
            ],
            ready: function () {
                var options = {
                    chart: {
                        plotBackgroundColor: null,
                        plotBorderWidth: null,
                        plotShadow: false,
                        renderTo: this.$.container
                    },
                    title: {
                        text: 'Incident Severity'
                    },
                    tooltip: {
                        pointFormat: '{series.name}: 
<b>{point.percentage:.1f}%</b>'
                    },
                    plotOptions: {
                        pie: {
                            allowPointSelect: true,
                            cursor: 'pointer',
                            dataLabels: {
                                enabled: true,
                                color: '#000000',
                                connectorColor: '#000000',
                                format: '<b>{point.name}</b>: 
{point.percentage:.1f} %'
                            }
                        }
                    },
                    series: [{
                        type: 'pie',
                        name: 'Severity',
                        data: this.datum
                    }]
                };
                //$("container").highcharts(options);
                //this.$.container.highcharts(options);
                var chart = new Highcharts.Chart(options);

            }
        });
    </script>
</polymer-element>

Any help would be appreciated.

Kind regards,
Satya.


Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to polymer-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to