ar.x_pos(curx + xval), this_y + self.width)
                curx += xval
                n += 1

    def get_legend_entry(self):
        if self.label:
            return legend.Entry(line_style=self.line_styles[0],
                                fill_style=self.fill_styles[0],
                                label=self.label)
        return None

    def draw(self, ar, can):
        assert chart_object.T.check_integrity(self)
        can.clip(ar.loc[0], ar.loc[1], ar.loc[0] + ar.size[0],
                 ar.loc[1] + ar.size[1])

        if self.direction == "vertical":
            self.draw_vertical(ar, can)
        else:
            self.draw_horizontal(ar, can)

        can.endclip()


def init():
    global fill_styles
    fill_styles = fill_style.standards.iterate()


theme.add_reinitialization_hook(init)
Beispiel #2
0
                            ar.y_pos(y - q_minus),
                            ar.y_pos(y + q_plus),
                        )
                else:
                    if None not in (minus, plus):  # PDS
                        self.error_bar.draw(can, (x_pos, y_pos), ar.y_pos(y - minus), ar.y_pos(y + plus))

            if self.tick_mark:
                self.tick_mark.draw(can, x_pos, y_pos)
            if self.data_label_format:
                can.show(
                    x_pos + self.data_label_offset[0],
                    y_pos + self.data_label_offset[1],
                    "/hC" + pychart_util.apply_format(self.data_label_format, (x, y), 1),
                )

        can.endclip()


def init():
    global line_style_itr
    line_styles = object_set.T()
    for org_style in line_style.standards.list():
        style = line_style.T(width=default_width, color=org_style.color, dash=org_style.dash)
        line_styles.add(style)

    line_style_itr = line_styles.iterate()


theme.add_reinitialization_hook(init)
Beispiel #3
0
        cur_width, cur_height, strs = line
        cur_y = y - cur_height
        y = y - cur_height
        out.comment("cury: %d hei %d str %s\n" % (cur_y, cur_height, strs))
        if halign == 'C':
            cur_x = -cur_width/2.0
        elif halign == 'R':
            cur_x = -cur_width
        else:
            cur_x = 0

	rel_x, rel_y = pychart_util.rotate(cur_x, cur_y, angle)
        out.text_begin()
        out.text_moveto(xscale(base_x + rel_x),
                        yscale(base_y + rel_y), angle)
        for segment in strs:
            font_name, size, color, str = segment
            out.text_show(font_name, nscale(size), color, str)
        out.text_end()
	
		
def verbatim(str):
    "Add STR to the output file verbatim." 
    out.verbatim(str)
def comment(str):
    "Add STR as a comment to the output file."
    out.comment(str)
	
init(None)
theme.add_reinitialization_hook(lambda: init(None))