title: Howe can I add alphanumeric data labels to a series in a scatter chart by openpyxl?
body: <p>I have an Excel table like this:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>A</th>
  <th>B</th>
  <th>C</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>a</td>
  <td>1</td>
  <td>7</td>
  </tr>
  <tr>
  <td>b</td>
  <td>3</td>
  <td>4</td>
  </tr>
  <tr>
  <td>c</td>
  <td>6</td>
  <td>2</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I created a scatter chart by openpyxl by using column C for values and column B for xvalues. I would like to use column A for alphanumeric data labels for points, but I cannot find a way. If I write</p>
  <p>series_data = xl.chart.series.Series(yVal=series_y, xVal=series_x, dLbls=data_labels)</p>
  <p>I get an error because openpyxl expect labels to be integers. Any idea why? Here is a full working code...</p>
  <pre><code>import openpyxl as xl
  # Create workbook and data sheet
  wb = xl.Workbook()
  ws = wb.active
  ws.title = &quot;Data&quot;
  # Prepare data
  headers = [&quot;Labels&quot;, &quot;X values&quot;, &quot;Y values&quot;]
  data = [[&quot;A&quot;, &quot;B&quot;, &quot;C&quot;, &quot;D&quot;, &quot;E&quot;], [12, 23, 34, 45, 56], [65, 45, 38, 92, 17]]
  # Write data in sheet
  for col in range(1, 4):
      ws.cell(row=1, column=col).value = headers[col - 1]
      for row in range(2, 7):
          ws.cell(row=row, column=col).value = data[col - 1][row - 2]
  
  # Select data for chart
  mr = ws.max_row
  chart_title = &quot;Scatter chart&quot;
  chart_ref_x = xl.chart.Reference(ws, min_col=2, min_row=2, max_row=mr) # X values
  chart_ref_y = xl.chart.Reference(ws, min_col=3, min_row=2, max_row=mr) # Y values
  chart_ref_l = xl.chart.Reference(ws, min_col=1, min_row=2, max_row=mr) # Data labels
  
  # Make scatter chart
  scatter_chart = xl.chart.ScatterChart()
  scatter_chart.title = chart_title
  scatter_chart.x_axis.title = &quot;X values&quot;
  scatter_chart.y_axis.title = &quot;Y values&quot;
  scatter_chart.legend = None
  # Create series
  series_data = xl.chart.Series(values= chart_ref_y, xvalues= chart_ref_x)
  series_data.graphicalProperties.line.noFill = True
  series_data.marker = xl.chart.marker.Marker('diamond')
  series_data.marker.size = 8
  
  # Add labels to series from chart_ref_l
  # *** WHAT I WANT IS TO ADD &quot;A&quot;, &quot;B&quot;, &quot;C&quot;, etc... as labels to chart points... but HOW? ***
  
  # Add series to chart
  scatter_chart.series.append(series_data)
  # Create chartsheet and add chart
  chart_sheet = wb.create_chartsheet(title=&quot;Scatter chart&quot;)
  chart_sheet.add_chart(scatter_chart)
  # Save workbook
  wb.save(&quot;labels.xlsx&quot;)
  # Close it
  wb.close()
  </code></pre>
  <p>What I need is to undestand how to create data labels for the points in scatter chart whose values are in column 1 (chart_ref_l).</p>