{"id":102,"date":"2026-03-07T11:06:50","date_gmt":"2026-03-07T03:06:50","guid":{"rendered":"https:\/\/xlwings.net\/blog\/?p=102"},"modified":"2026-01-17T11:21:35","modified_gmt":"2026-01-17T11:21:35","slug":"common-properties-and-methods-of-the-chart-object","status":"publish","type":"post","link":"https:\/\/xlwings.net\/blog\/common-properties-and-methods-of-the-chart-object\/","title":{"rendered":"Common Properties and Methods of the Chart Object"},"content":{"rendered":"<h2>Method<\/h2>\n<table>\n<tbody>\n<tr>\n<td>\n<p>Name<\/p>\n<\/td>\n<td>\n<p>Meaning<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>BackWall<\/p>\n<\/td>\n<td>\n<p>Returns the Walls object, which allows users to format the background wall of a 3D chart individually.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>BarShape<\/p>\n<\/td>\n<td>\n<p>Shape of the bars<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>ChartArea<\/p>\n<\/td>\n<td>\n<p>Returns the ChartArea object, representing the entire chart area<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>ChartStyle<\/p>\n<\/td>\n<td>\n<p>Returns or sets the chart style. You can use a number between 1 and 48 to set the chart style<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>ChartTitle<\/p>\n<\/td>\n<td>\n<p>Returns the ChartTitle object, representing the title of the specified chart<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>ChartType<\/p>\n<\/td>\n<td>\n<p>Returns or sets the chart type<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Copy<\/p>\n<\/td>\n<td>\n<p>Copies the chart worksheet to another location in the workbook<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>CopyPicture<\/p>\n<\/td>\n<td>\n<p>Copies the chart as an image to the clipboard<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>DataTable<\/p>\n<\/td>\n<td>\n<p>Returns the DataTable object, representing the data table of this chart<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Delete<\/p>\n<\/td>\n<td>\n<p>Deletes the chart<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Export<\/p>\n<\/td>\n<td>\n<p>Exports the chart as an image file<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>HasAxis<\/p>\n<\/td>\n<td>\n<p>Returns or sets the axis displayed on the chart<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>HasDataTable<\/p>\n<\/td>\n<td>\n<p>Returns True if the chart has a data table, otherwise False<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>HasTitle<\/p>\n<\/td>\n<td>\n<p>Sets whether to display the title<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Legend<\/p>\n<\/td>\n<td>\n<p>Returns a Legend object, representing the chart legend<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Move<\/p>\n<\/td>\n<td>\n<p>Moves the chart worksheet to another location in the workbook<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Name<\/p>\n<\/td>\n<td>\n<p>The name of the chart<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>PlotArea<\/p>\n<\/td>\n<td>\n<p>Returns a PlotArea object, representing the plot area of the chart<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>PlotBy<\/p>\n<\/td>\n<td>\n<p>Returns or sets the way rows or columns are used as data series in the chart. This can be one of the XlRowCol constants: xlColumns or xlRows<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>SaveAs<\/p>\n<\/td>\n<td>\n<p>Saves the chart to a different file<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Select<\/p>\n<\/td>\n<td>\n<p>Selects the chart<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>SeriesCollection<\/p>\n<\/td>\n<td>\n<p>Returns a collection containing all series in the chart<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>SetElement<\/p>\n<\/td>\n<td>\n<p>Sets chart elements<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>SetSourceData<\/p>\n<\/td>\n<td>\n<p>Binds the data used to draw the chart<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Visible<\/p>\n<\/td>\n<td>\n<p>Returns or sets an XlSheetVisibility value to determine whether the object is visible<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Walls<\/p>\n<\/td>\n<td>\n<p>Returns a Walls object, representing the background walls of a 3D chart<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u00a0<\/p>\n<p>sht.api.Range(&#8216;A1:B7&#8217;).Select()\u00a0\u00a0\u00a0 #Data<\/p>\n<p>cht=sht.api.Shapes.AddChart2().Chart\u00a0\u00a0\u00a0 #Add chart<\/p>\n<p>axs=cht.Axes(1)\u00a0\u00a0\u00a0 #Horizontal axis<\/p>\n<p>axs2=cht.Axes(2)\u00a0\u00a0\u00a0 #Vertical axis<\/p>\n<p>axs.HasTitle=True\u00a0\u00a0\u00a0 #X axis title<\/p>\n<p>axs.AxisTitle.Caption=&#8217;X Axis Title&#8217;\u00a0\u00a0\u00a0 #Title text<\/p>\n<p>axs.AxisTitle.Font.Italic=True\u00a0\u00a0\u00a0 #Font Italic<\/p>\n<p>axs.AxisTitle.Font.Color=xw.utils.rgb_to_int((255, 0, 0))\u00a0\u00a0\u00a0 #Font color is red<\/p>\n<p>axs2.HasTitle=True\u00a0\u00a0\u00a0 #Vertical axis has title<\/p>\n<p>axs2.AxisTitle.Caption=&#8217;Y Axis Title&#8217;\u00a0\u00a0\u00a0 #Title text<\/p>\n<p>axs2.AxisTitle.Font.Bold=True\u00a0\u00a0\u00a0 #Font bold<\/p>\n<h2>Sample Code<\/h2>\n\n\n<pre class=\"wp-block-code\"><code>#Other Members of Chart Object\n\nimport xlwings as xw\nimport os\n\nroot=os.getcwd()\napp=xw.App(visible=True,add_book=False)\nwb=app.books.open('GDP.xlsx',read_only=False)\nsht=wb.sheets('Sheet1')\n\nsht.api.Range('A1:B7').Select()    #Data\ncht=sht.api.Shapes.AddChart2().Chart    #Add chart\naxs=cht.Axes(1)    #Horizontal axis\naxs2=cht.Axes(2)    #Vertical axis\naxs.HasTitle=True    #X axis title\naxs.AxisTitle.Caption='X Axis Title'    #Title text\naxs.AxisTitle.Font.Italic=True    #Font Italic\naxs.AxisTitle.Font.Color=xw.utils.rgb_to_int((255, 0, 0))    #Font color is red\naxs2.HasTitle=True    #Vertical axis has title\naxs2.AxisTitle.Caption='Y Axis Title'    #Title text\naxs2.AxisTitle.Font.Bold=True    #Font bold\n\n#wb.save()\n#wb.close()\n#app.kill()<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"883\" height=\"718\" src=\"https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/03\/image-10.png\" alt=\"Common Properties and Methods of the Chart Object\" class=\"wp-image-486\" srcset=\"https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/03\/image-10.png 883w, https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/03\/image-10-300x244.png 300w, https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/03\/image-10-768x624.png 768w\" sizes=\"auto, (max-width: 883px) 100vw, 883px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Method<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-102","post","type-post","status-publish","format-standard","hentry","category-xlwings-chart"],"_links":{"self":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/102","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/comments?post=102"}],"version-history":[{"count":3,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/102\/revisions"}],"predecessor-version":[{"id":488,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/102\/revisions\/488"}],"wp:attachment":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/media?parent=102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/categories?post=102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/tags?post=102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}