add options on chart rendering series

Issue #150 resolved
Kay_Winkler
created an issue

added some usefull options for the chart rendering of series. Most required one is the 'showVal', which enables to have numbers on to of bars or graphs

{{{

!python

diff -Naur openpyxl/chart.py openpyxl-n-patch/chart.py --- openpyxl/chart.py 2012-09-11 11:18:30.761625250 +0200 +++ openpyxl-n-patch/chart.py 2012-09-11 12:55:30.165274671 +0200 @@ -133,6 +133,14 @@ self.legend = legend self.error_bar = None self._color = color + ''' add some series properties ''' + self.showLegendKey = '0' + self.showVal = '0' + self.showCatName = '0' + self.showSerName = '0' + self.showPercent = '0' + self.showBubbleSize = '0' + self.showLeaderLines = '0'

 def _get_color(self):
     return self._color

diff -Naur openpyxl/writer/charts.py openpyxl-n-patch/writer/charts.py --- openpyxl/writer/charts.py 2012-09-11 11:18:30.761625250 +0200 +++ openpyxl-n-patch/writer/charts.py 2012-09-11 12:57:16.133270239 +0200 @@ -177,6 +177,15 @@ marker = SubElement(ser, 'c:marker') SubElement(marker, 'c:symbol', {'val':serie.marker})

  • data_lable = SubElement(ser, 'c:dLbls')
  • SubElement(data_lable, 'c:showLegendKey', {'val':str(serie.showLegendKey)})
  • SubElement(data_lable, 'c:showVal', {'val':str(serie.showVal)})
  • SubElement(data_lable, 'c:showCatName', {'val':str(serie.showCatName)})
  • SubElement(data_lable, 'c:showSerName', {'val':str(serie.showSerName)})
  • SubElement(data_lable, 'c:showPercent', {'val':str(serie.showPercent)})
  • SubElement(data_lable, 'c:showBubbleSize', {'val':str(serie.showBubbleSize)})
  • SubElement(data_lable, 'c:showLeaderLines', {'val':str(serie.showLeaderLines)}) + if serie.labels: cat = SubElement(ser, 'c:cat') self._write_serial(cat, serie.labels)

}}}

Comments (4)

  1. Log in to comment