{"id":607,"date":"2026-05-11T18:19:19","date_gmt":"2026-05-11T10:19:19","guid":{"rendered":"https:\/\/xlwings.net\/blog\/?p=607"},"modified":"2026-03-24T02:55:02","modified_gmt":"2026-03-24T02:55:02","slug":"how-to-set-vector-format-output-using-xlwings","status":"publish","type":"post","link":"https:\/\/xlwings.net\/blog\/how-to-set-vector-format-output-using-xlwings\/","title":{"rendered":"How To Set Vector Format Output Using xlwings?"},"content":{"rendered":"<p style=\"margin: 0in; font-size: 16.0pt;\"><span lang=\"zh-CN\" style=\"font-family: 'Microsoft YaHei';\">\u3010<\/span><span lang=\"en-US\" style=\"font-weight: bold; font-family: Calibri;\">Example<\/span><span lang=\"zh-CN\" style=\"font-family: 'Microsoft YaHei';\">\u3011<\/span><\/p>\n\n\n<pre class=\"wp-block-code\"><code>import xlwings as xw\nimport os\n\ndef set_style(cht):\n    cht.ChartArea.Format.Line.Visible=False\n    cht.PlotArea.Format.Fill.Visible=False\n    cht.PlotArea.Format.Line.Visible=True\n    cht.PlotArea.Format.Line.ForeColor.RGB=xw.utils.rgb_to_int((200,200,200))\n    #cht.PlotArea.Format.Line.ForeColor.ObjectThemeColor = msoThemeColorText1\n    ax1=cht.Axes(1)\n    ax2=cht.Axes(2)\n    ax1.HasTitle=True\n    ax1.AxisTitle.Text='Categories'\n    ax1.AxisTitle.Font.Size=10\n    ax1.TickLabels.Font.Size=8\n    #ax1.TickLabels.NumberFormat='0.00'\n    ax1.HasMajorGridlines=False\n    ax2.HasTitle=True\n    ax2.AxisTitle.Text='Values'\n    ax2.AxisTitle.Font.Size=10\n    ax2.TickLabels.Font.Size=8\n    ax2.HasMajorGridlines=False\n    cht.HasTitle=True\n    #cht.ChartTitle.Caption='Plot'\n    #cht.ChartTitle.Font.Size=12\n\nroot=os.getcwd()\napp=xw.App(visible=True,add_book=False)\nwb=app.books.open(root+r'\/data.xlsx',read_only=False)\nsht=wb.sheets('Sheet1')\n\nsht.api.Range('A2:C11').Select()\nshp=sht.api.Shapes.AddChart2(-1,xw.constants.ChartType.xlColumnClustered,20,20,350,250,True)\ncht=shp.Chart\n\nset_style(cht)\n\n#wb.save()\n#app.kill()<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Method<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[],"class_list":["post-607","post","type-post","status-publish","format-standard","hentry","category-xlwings-advanced-chart"],"_links":{"self":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/607","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/comments?post=607"}],"version-history":[{"count":1,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/607\/revisions"}],"predecessor-version":[{"id":1457,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/607\/revisions\/1457"}],"wp:attachment":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/media?parent=607"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/categories?post=607"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/tags?post=607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}