{"id":2183,"date":"2026-07-14T07:07:44","date_gmt":"2026-07-13T23:07:44","guid":{"rendered":"https:\/\/xlwings.net\/blog\/?p=2183"},"modified":"2026-03-28T09:43:45","modified_gmt":"2026-03-28T09:43:45","slug":"how-to-use-applicationshowcharttipnames-in-the-xlwings-api-way","status":"publish","type":"post","link":"https:\/\/xlwings.net\/blog\/how-to-use-applicationshowcharttipnames-in-the-xlwings-api-way\/","title":{"rendered":"How to use Application.ShowChartTipNames in the xlwings API way"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The <code>ShowChartTipNames<\/code> property of the <code>Application<\/code> object in Excel is a setting that controls whether chart tip names are displayed. Chart tips are the small pop-up labels that appear when you hover the mouse pointer over a chart element, such as a data point, series, or axis title. These tips typically show the name and value of the element. When <code>ShowChartTipNames<\/code> is set to <code>True<\/code>, these names are included in the tooltip. When set to <code>False<\/code>, only the values are shown, if applicable. This property is part of a group of settings that manage on-screen feedback and can be useful for creating cleaner visual presentations or for users who are already familiar with the chart&#8217;s data structure and do not require the additional descriptive text.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the xlwings library, which provides a Pythonic interface to automate and interact with Excel, you access this property through the <code>Application<\/code> object. The syntax is straightforward, as it is a simple property getter and setter. The property expects a Boolean value (<code>True<\/code> or <code>False<\/code>).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>xlwings API Syntax:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>app = xw.App() # Get the active or a new Excel application instance\n# To get the current setting\ncurrent_setting = app.api.ShowChartTipNames\n# To set the property\napp.api.ShowChartTipNames = True # or False<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Here, <code>app.api<\/code> provides direct access to the underlying Excel VBA object model. The <code>ShowChartTipNames<\/code> property does not take any arguments; it is simply read or written to.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><br>The following example demonstrates how to toggle the <code>ShowChartTipNames<\/code> setting and verify its state. This can be integrated into a larger script that prepares an Excel environment for a specific reporting task, ensuring that chart tooltips conform to a desired standard.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import xlwings as xw\n\n# Connect to the active Excel instance\nwith xw.App(visible=True) as app:\n# Get the current setting and print it\noriginal_setting = app.api.ShowChartTipNames\nprint(f\"Original ShowChartTipNames setting: {original_setting}\")\n\n# Disable the display of names in chart tips\napp.api.ShowChartTipNames = False\nprint(\"ShowChartTipNames has been set to False. Chart tooltips will now only show values.\")\n\n# For demonstration, create a simple chart to see the effect\nwb = app.books.add()\nsheet = wb.sheets&#91;0]\n# Add some sample data\nsheet.range('A1').value = &#91;&#91;'Category', 'Value'],\n&#91;'A', 10],\n&#91;'B', 20],\n&#91;'C', 15]]\n# Create a chart\nchart = sheet.charts.add()\nchart.set_source_data(sheet.range('A1').expand())\nchart.chart_type = 'column_clustered'\nchart.api&#91;1].HasTitle = True\nchart.api&#91;1].ChartTitle.Text = \"Sample Chart\"\n\n# Pause to allow user to hover over chart and observe tooltips\ninput(\"Hover over a column in the chart. The tooltip should show only the value (e.g., '20'). Press Enter to continue...\")\n\n# Re-enable the display of names\napp.api.ShowChartTipNames = True\nprint(\"ShowChartTipNames has been restored to True. Tooltips will now show names and values.\")\n\ninput(\"Hover over a column again. The tooltip should now show both name and value (e.g., 'B: 20'). Press Enter to exit...\")\n\n# Optionally, restore the original setting before closing\napp.api.ShowChartTipNames = original_setting\nwb.close()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The `ShowChartTipNames` property of the `Application` object in Excel is a setting that controls whe&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"class_list":["post-2183","post","type-post","status-publish","format-standard","hentry","category-xlwings-api-reference"],"_links":{"self":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/2183","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=2183"}],"version-history":[{"count":2,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/2183\/revisions"}],"predecessor-version":[{"id":3339,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/2183\/revisions\/3339"}],"wp:attachment":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/media?parent=2183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/categories?post=2183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/tags?post=2183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}