svg/charts/graph.py
def make_datapoint_text(self, x, y, value, style=None):
		"""
		Add text for a datapoint
		"""
		if not self.show_data_values:
			# do nothing
			return
		# first lay down the text in a wide white stroke to
		#  differentiate it from the background
		e = etree.SubElement(self.foreground, 'text', {
			'x': str(x),
			'y': str(y),
			'class': 'dataPointLabel',
			'style': '%(style)s stroke: #fff; stroke-width: 2;' % vars(),
		})
		e.text = str(value)
		# then lay down the text in the specified style
		e = etree.SubElement(self.foreground, 'text', {
			'x': str(x),
			'y': str(y),
			'class': 'dataPointLabel'})
		e.text = str(value)
		if style:
			e.set('style', style)
def make_datapoint_text(self, x, y, value, style=None):
		if not self.show_data_values:
			# do nothing
			return
		# first lay down the text in a wide white stroke to
		#  differentiate it from the background
		e = etree.SubElement(self.foreground, 'text', {
			'x': str(x),
			'y': str(y),
			'class': 'dataPointLabel',
			'style': '%(style)s stroke: #fff; stroke-width: 2;' % vars(),
		})
		e.text = str(value)
		# then lay down the text in the specified style
		e = etree.SubElement(self.foreground, 'text', {
			'x': str(x),
			'y': str(y),
			'class': 'dataPointLabel'})
		e.text = str(value)
		if style:
			e.set('style', style)
def make_datapoint_text ( self , x , y , value , style = None ) : if not self . show_data_values : # do nothing return # first lay down the text in a wide white stroke to #  differentiate it from the background e = etree . SubElement ( self . foreground , 'text' , { 'x' : str ( x ) , 'y' : str ( y ) , 'class' : 'dataPointLabel' , 'style' : '%(style)s stroke: #fff; stroke-width: 2;' % vars ( ) , } ) e . text = str ( value ) # then lay down the text in the specified style e = etree . SubElement ( self . foreground , 'text' , { 'x' : str ( x ) , 'y' : str ( y ) , 'class' : 'dataPointLabel' } ) e . text = str ( value ) if style : e . set ( 'style' , style )
Add text for a datapoint
Add text for a datapoint