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

Pie Chart renders but legend does not #97

Closed
rmcsharry opened this issue Aug 29, 2016 · 2 comments
Closed

Pie Chart renders but legend does not #97

rmcsharry opened this issue Aug 29, 2016 · 2 comments

Comments

@rmcsharry
Copy link

rmcsharry commented Aug 29, 2016

Using this simple pie chart the legend is rendered 0 x 0, so you cannot see it. If you change the type to 'line' then you can see the legend. Not sure if this is a bug with ember-highcharts or with highcharts itself.

  chartOptions: {
    chart: {
      type: 'pie'
    },
    title: {
      text: 'Total weight of gear in each category'
    },
    legend: {
        align: 'right',
        verticalAlign: 'top',
        layout: 'vertical',
        x: 0,
        y: 100
    },    
  },

  chartData: [{
    data: [ 
        {y: 10, name: 'Test1'},
        {y: 12, name: 'Test2'},
        {y: 40, name: 'Test3'}
      ]
  }],
@rmcsharry
Copy link
Author

Here is a jsfiddle:
http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/plotoptions/pie-datalabels-distance/

If you simply paste the legend section to that fiddle and re-run, it also does not show. Seems to be an issue with highcharts then?

@rmcsharry
Copy link
Author

rmcsharry commented Aug 29, 2016

This code DOES show a legend, go figure.


  chartOptions: {
        chart: {
            plotBackgroundColor: null,
            plotBorderWidth: null,
            plotShadow: false,
            type: 'pie'
        },
        title: {
            text: 'Browser market shares January, 2015 to May, 2015'
        },
        tooltip: {
            pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
        },
        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                dataLabels: {
                    enabled: false
                },
                showInLegend: true
            }
        },
        legend: {
          align: 'right',
          verticalAlign: 'top',
          layout: 'vertical',
          x: 0,
          y: 100
        }
  },

  chartData: [{
    data: [ 
        {y: 10, name: 'Test1'},
        {y: 12, name: 'Test2'},
        {y: 40, name: 'Test3'}
      ]
  }],

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