{"id":104,"date":"2026-03-08T11:44:26","date_gmt":"2026-03-08T03:44:26","guid":{"rendered":"https:\/\/xlwings.net\/blog\/?p=104"},"modified":"2026-01-17T11:25:16","modified_gmt":"2026-01-17T11:25:16","slug":"how-to-set-properties-of-individual-points-in-a-series-using-xlwings","status":"publish","type":"post","link":"https:\/\/xlwings.net\/blog\/how-to-set-properties-of-individual-points-in-a-series-using-xlwings\/","title":{"rendered":"How To Set Properties of Individual Points in a Series Using xlwings?"},"content":{"rendered":"<h2>Method<\/h2>\n<p>Using the `Points` property of a Series object, you can get all the data points in a series. By using an index, you can extract and set one or more specific points. A single point is represented by a Point object, and its properties and methods can be used to modify the point. This is mainly used for line charts, scatter plots, and radar charts.<\/p>\n<p>\u00a0<\/p>\n<p>In the following example, the properties of the third point in the line chart of series 2 are modified. The foreground and background colors are set to blue, the marker style is changed to a diamond, and the marker size is set to 10.<\/p>\n<p>\u00a0<\/p>\n<p>sht.api.Range(&#8216;A1:B7&#8217;).Select()<\/p>\n<p>cht=sht.api.Shapes.AddChart().Chart<\/p>\n<p>ser2=cht.SeriesCollection(&#8216;P2&#8217;)\u00a0\u00a0\u00a0 #Second series<\/p>\n<p>ser2.ChartType=xw.constants.ChartType.xlLine\u00a0\u00a0\u00a0 #Line chart<\/p>\n<p>ser2.Smooth=True\u00a0\u00a0\u00a0 #Smooth processing<\/p>\n<p>ser2.MarkerStyle=xw.constants.MarkerStyle.xlMarkerStyleTriangle\u00a0\u00a0\u00a0 #Markers<\/p>\n<p>ser2.MarkerForegroundColor=xw.utils.rgb_to_int((0,0,255))\u00a0\u00a0\u00a0 #Color<\/p>\n<p>ser2.HasDataLabels=True\u00a0\u00a0\u00a0 #Data labels<\/p>\n<p>ser2.Points(3).MarkerForegroundColor=xw.utils.rgb_to_int((0,0,255))<\/p>\n<p>ser2.Points(3).MarkerBackgroundColor=xw.utils.rgb_to_int((0,0,255))<\/p>\n<p>ser2.Points(3).MarkerStyle=xw.constants.MarkerStyle.xlMarkerStyleDiamond<\/p>\n<p>ser2.Points(3).MarkerSize=10<\/p>\n<h2>Sample Code<\/h2>\n\n\n<pre class=\"wp-block-code\"><code>#Set Points in Series\n\nimport xlwings as xw\nimport os\n\nroot = os.getcwd()\napp = xw.App(visible=True, add_book=False)\nwb=app.books.open(root+r'\/P1P2.xlsx',read_only=False)\nsht=wb.sheets(1)\n\nsht.api.Range('A1:B7').Select()\ncht=sht.api.Shapes.AddChart().Chart\nser2=cht.SeriesCollection('P2')    #Second series\nser2.ChartType=xw.constants.ChartType.xlLine    #Line chart\nser2.Smooth=True    #Smooth processing\nser2.MarkerStyle=xw.constants.MarkerStyle.xlMarkerStyleTriangle    #Markers\nser2.MarkerForegroundColor=xw.utils.rgb_to_int((0,0,255))    #Color\nser2.HasDataLabels=True    #Data labels\nser2.Points(3).MarkerForegroundColor=xw.utils.rgb_to_int((0,0,255))\nser2.Points(3).MarkerBackgroundColor=xw.utils.rgb_to_int((0,0,255))\nser2.Points(3).MarkerStyle=xw.constants.MarkerStyle.xlMarkerStyleDiamond\nser2.Points(3).MarkerSize=10\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=\"555\" src=\"https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/03\/image-12.png\" alt=\"Set Properties of Individual Points in a Series Using xlwings\" class=\"wp-image-492\" srcset=\"https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/03\/image-12.png 883w, https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/03\/image-12-300x189.png 300w, https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/03\/image-12-768x483.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-104","post","type-post","status-publish","format-standard","hentry","category-xlwings-chart"],"_links":{"self":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/104","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=104"}],"version-history":[{"count":2,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/104\/revisions"}],"predecessor-version":[{"id":493,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/104\/revisions\/493"}],"wp:attachment":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/media?parent=104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/categories?post=104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/tags?post=104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}