Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have an excel sheet with some data in first two columns. I created a simple chart with this data. I am facing problem in adding axis labels to the chart.

here is my script

from win32com.client import Dispatch, constants
excel = win32com.client.Dispatch('Excel.Application')
wb = excel.Workbooks.Open( 'output_data.xls', False, True)
excel.Visible = False
ws1 = wb.Worksheets('sheet_1)
ch = ws1.Shapes.AddChart( 73, 200, 50, 800, 500).Select()
excel.ActiveChart.ApplyLayout(1)
excel.ActiveChart.SetSourceData(Source=ws1.Range("$A:$B"))
excel.ActiveChart.ChartTitle.Text = "Integral"
excel.ActiveChart.Legend.Delete()

-------up to this everything fine.

excel.ActiveChart.axes(constants.xlCategory).AxisTitle.Caption = "Z_coordinate" 

but when I add the axis labels, it returns with an attribute error xlCategory.

how can I add the axis labels and change the font size.

Thanks in advance.

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.