{"action":"created","issue":{"url":"https://api.github.com/repos/jmcnamara/XlsxWriter/issues/297","labels_url":"https://api.github.com/repos/jmcnamara/XlsxWriter/issues/297/labels{/name}","comments_url":"https://api.github.com/repos/jmcnamara/XlsxWriter/issues/297/comments","events_url":"https://api.github.com/repos/jmcnamara/XlsxWriter/issues/297/events","html_url":"https://github.com/jmcnamara/XlsxWriter/issues/297","id":106546100,"number":297,"title":"Pie chart from table broken in Excel 2007","user":{"login":"NotSqrt","id":1997005,"avatar_url":"https://avatars.githubusercontent.com/u/1997005?v=3","gravatar_id":"","url":"https://api.github.com/users/NotSqrt","html_url":"https://github.com/NotSqrt","followers_url":"https://api.github.com/users/NotSqrt/followers","following_url":"https://api.github.com/users/NotSqrt/following{/other_user}","gists_url":"https://api.github.com/users/NotSqrt/gists{/gist_id}","starred_url":"https://api.github.com/users/NotSqrt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NotSqrt/subscriptions","organizations_url":"https://api.github.com/users/NotSqrt/orgs","repos_url":"https://api.github.com/users/NotSqrt/repos","events_url":"https://api.github.com/users/NotSqrt/events{/privacy}","received_events_url":"https://api.github.com/users/NotSqrt/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jmcnamara/XlsxWriter/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/jmcnamara/XlsxWriter/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":{"login":"jmcnamara","id":94267,"avatar_url":"https://avatars.githubusercontent.com/u/94267?v=3","gravatar_id":"","url":"https://api.github.com/users/jmcnamara","html_url":"https://github.com/jmcnamara","followers_url":"https://api.github.com/users/jmcnamara/followers","following_url":"https://api.github.com/users/jmcnamara/following{/other_user}","gists_url":"https://api.github.com/users/jmcnamara/gists{/gist_id}","starred_url":"https://api.github.com/users/jmcnamara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmcnamara/subscriptions","organizations_url":"https://api.github.com/users/jmcnamara/orgs","repos_url":"https://api.github.com/users/jmcnamara/repos","events_url":"https://api.github.com/users/jmcnamara/events{/privacy}","received_events_url":"https://api.github.com/users/jmcnamara/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-09-15T12:37:13Z","updated_at":"2015-09-15T14:10:12Z","closed_at":null,"body":"Hello !\r\n\r\nStraight to the point: the first slice is missing when creating a pie chart from a range that is also in a table.\r\n\r\nExcel 2007\r\n========\r\n:warning: missing slice \r\n![excel2007](https://cloud.githubusercontent.com/assets/1997005/9876454/7023909c-5bb6-11e5-98ed-dcf0e09fe1c3.png)\r\n\r\nExcel 2010\r\n=========\r\n![excel2010](https://cloud.githubusercontent.com/assets/1997005/9876456/73fe96f8-5bb6-11e5-8b4e-790b1a8c7995.png)\r\n\r\nLibreOffice\r\n=========\r\n![libreoffice](https://cloud.githubusercontent.com/assets/1997005/9876458/77a6abb0-5bb6-11e5-8940-b45a84eec68b.png)\r\n\r\n\r\nCode to generate\r\n==============\r\nAdapted from the chart3 of the ``example_pie_chart.py``\r\n\r\n```python\r\n#######################################################################\r\n#\r\n# An example of creating Excel Pie charts with Python and XlsxWriter.\r\n#\r\n# The demo also shows how to set segment colours. It is possible to\r\n# define chart colors for most types of XlsxWriter charts\r\n# via the add_series() method. However, Pie/Doughnut charts are a special\r\n# case since each segment is represented as a point so it is necessary to\r\n# assign formatting to each point in the series.\r\n#\r\n# Copyright 2013-2015, John McNamara, jmcnamara@cpan.org\r\n#\r\nimport xlsxwriter\r\n\r\nworkbook = xlsxwriter.Workbook('chart_pie.xlsx')\r\n\r\nworksheet = workbook.add_worksheet()\r\nbold = workbook.add_format({'bold': 1})\r\n\r\n# Add the worksheet data that the charts will refer to.\r\nheadings = ['Category', 'Values']\r\ndata = [\r\n    ['Apple', 'Cherry', 'Pecan'],\r\n    [60, 30, 10],\r\n]\r\n\r\nworksheet.write_row('A1', headings, bold)\r\nworksheet.write_column('A2', data[0])\r\nworksheet.write_column('B2', data[1])\r\n\r\n# If we comment this, it works properly in excel 2007\r\nworksheet.add_table(\r\n    first_row=0,\r\n    first_col=0,\r\n    last_row=len(data[0]),\r\n    last_col=1,\r\n    options={\r\n        'header_row': True,\r\n        'autofilter': False,\r\n        'columns': [{'header': \"Category\"}, {\"header\": \"Value\"}],\r\n    }\r\n)\r\n\r\n#######################################################################\r\n#\r\n# Create a Pie chart with rotation of the segments.\r\n#\r\n\r\n# Create an example Pie chart like above.\r\nchart3 = workbook.add_chart({'type': 'pie'})\r\n\r\n# Configure the series.\r\nchart3.add_series({\r\n    'name': 'Pie sales data',\r\n    'categories': '=Sheet1!A2:A4',\r\n    'values': '=Sheet1!B2:B4',\r\n})\r\n\r\n# Add a title.\r\nchart3.set_title({'name': 'Pie Chart with segment rotation'})\r\n\r\n# Change the angle/rotation of the first segment.\r\nchart3.set_rotation(90)\r\n\r\n# Insert the chart into the worksheet (with an offset).\r\nworksheet.insert_chart('C10', chart3, {'x_offset': 25, 'y_offset': 10})\r\n\r\nworkbook.close()\r\n```\r\n\r\nAny ideas ?\r\n"},"comment":{"url":"https://api.github.com/repos/jmcnamara/XlsxWriter/issues/comments/140405300","html_url":"https://github.com/jmcnamara/XlsxWriter/issues/297#issuecomment-140405300","issue_url":"https://api.github.com/repos/jmcnamara/XlsxWriter/issues/297","id":140405300,"user":{"login":"NotSqrt","id":1997005,"avatar_url":"https://avatars.githubusercontent.com/u/1997005?v=3","gravatar_id":"","url":"https://api.github.com/users/NotSqrt","html_url":"https://github.com/NotSqrt","followers_url":"https://api.github.com/users/NotSqrt/followers","following_url":"https://api.github.com/users/NotSqrt/following{/other_user}","gists_url":"https://api.github.com/users/NotSqrt/gists{/gist_id}","starred_url":"https://api.github.com/users/NotSqrt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NotSqrt/subscriptions","organizations_url":"https://api.github.com/users/NotSqrt/orgs","repos_url":"https://api.github.com/users/NotSqrt/repos","events_url":"https://api.github.com/users/NotSqrt/events{/privacy}","received_events_url":"https://api.github.com/users/NotSqrt/received_events","type":"User","site_admin":false},"created_at":"2015-09-15T14:10:11Z","updated_at":"2015-09-15T14:10:11Z","body":"Hi,\r\n\r\nNo difference without that line."}}