excel - How to create chart with xlsxwriter with no "Horizontal (Value) Axis" -
how remove "horizontal (value) axis" excel 2013 chart xlsxwriter.
xlsxwriter documentation silent it.
i have tried:
chart.set_x_axis({none: true}) chart.set_y_axis({none: true})
not work.
on excel able remove axis selecting itand hitting delete key.
you can set axis label_position
(docs) none
hide axis:
chart.set_x_axis({'label_position': 'none'})
for example:
import xlsxwriter workbook = xlsxwriter.workbook('chart.xlsx') worksheet = workbook.add_worksheet() worksheet.write_column('a1', [10, 40, 50]) chart = workbook.add_chart({'type': 'bar', 'subtype': 'percent_stacked'}) chart.add_series({'values': '=sheet1!$a$1', 'data_labels': {'value': 1}}) chart.add_series({'values': '=sheet1!$a$2', 'data_labels': {'value': 1}}) chart.add_series({'values': '=sheet1!$a$3', 'data_labels': {'value': 1}}) chart.set_legend({'none': true}) chart.set_x_axis({'label_position': 'none'}) worksheet.insert_chart('d2', chart) workbook.close()
output:
Comments
Post a Comment