各位好,不好意思又遇到問題上網找不到答案,再麻煩幫忙。謝謝大家
問題:
建立長條圖後想要修改圖表標題字體大小跟圖表X軸標籤字體大小,我的程式碼如下。謝謝
chart =arChart()
chart.type "col"
chart.style 10
chart.title "CP W1_CLIP"
chart.gapWidth 500
chart.legend Legend()
chart.legend.position 'b'
chart.legend.layout None
chart.legend.overlay False
data = Reference(ws_new,in_col=2,in_row=1,ax_col=len(weeks)+1,ax_row=len(vend_names)+1)
cats = Reference(ws_new,in_col=1,in_row=2,ax_row=len(vend_names)+1)
chart.add_data(data,itles_from_data=True)
chart.set_categories(cats)
ws_new.add_chart(chart, "I2")
target_value 0.8
target_data [target_value] *en(vend_names)
target_ref Reference(ws_new,in_col=len(weeks) + 2,in_row=1,ax_row=len(vend_names) + 1)
for, value in enumerate(target_data, start=2):
ws_new.cell(row=i, column=len(weeks) + 2, value=value)
line_chartineChart()
line_chart.add_data(target_ref,itles_from_data=True)
line_chart.set_categories(cats)
for series inine_chart.series:
series.graphicalProperties.line.solidFill "FF0000"
series.graphicalProperties.line.width 9525 * 2
chart +=ine_chart
chart.width 36