def slice(
            self, serie_node, node, radius, small_radius, angle, start_angle,
            center, val, i, metadata
    ):
        """Draw a pie slice"""
        if angle == 2 * pi:
            angle = nearly_2pi

        if angle > 0:
            to = [
                coord_abs_project(center, radius, start_angle),
                coord_abs_project(center, radius, start_angle + angle),
                coord_abs_project(center, small_radius, start_angle + angle),
                coord_abs_project(center, small_radius, start_angle)
            ]
            rv = self.node(
                node,
                'path',
                d='M%s A%s 0 %d 1 %s L%s A%s 0 %d 0 %s z' % (
                    to[0], coord_dual(radius), int(angle > pi), to[1], to[2],
                    coord_dual(small_radius), int(angle > pi), to[3]
                ),
                class_='slice reactive tooltip-trigger'
            )
        else:
            rv = None
        x, y = coord_diff(
            center,
            coord_project((radius + small_radius) / 2, start_angle + angle / 2)
        )

        self.graph._tooltip_data(
            node, val, x, y, "centered", self.graph._x_labels
            and self.graph._x_labels[i][0]
        )
        if angle >= 0.3:  # 0.3 radians is about 17 degrees
            self.graph._static_value(serie_node, val, x, y, metadata)
        return rv
def slice ( self , serie_node , node , radius , small_radius , angle , start_angle , center , val , i , metadata ) : if angle == 2 * pi : angle = nearly_2pi if angle > 0 : to = [ coord_abs_project ( center , radius , start_angle ) , coord_abs_project ( center , radius , start_angle + angle ) , coord_abs_project ( center , small_radius , start_angle + angle ) , coord_abs_project ( center , small_radius , start_angle ) ] rv = self . node ( node , 'path' , d = 'M%s A%s 0 %d 1 %s L%s A%s 0 %d 0 %s z' % ( to [ 0 ] , coord_dual ( radius ) , int ( angle > pi ) , to [ 1 ] , to [ 2 ] , coord_dual ( small_radius ) , int ( angle > pi ) , to [ 3 ] ) , class_ = 'slice reactive tooltip-trigger' ) else : rv = None x , y = coord_diff ( center , coord_project ( ( radius + small_radius ) / 2 , start_angle + angle / 2 ) ) self . graph . _tooltip_data ( node , val , x , y , "centered" , self . graph . _x_labels and self . graph . _x_labels [ i ] [ 0 ] ) if angle >= 0.3 : self . graph . _static_value ( serie_node , val , x , y , metadata ) return rv
Draw a pie slice