def generate_chart(self, properties):
<EOL>if not {'<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'}.issubset(set(properties.keys())):<EOL><INDENT>raise RuntimeError("<STR_LIT>" % properties.keys())<EOL><DEDENT>mask = self.__filter_data(properties['<STR_LIT>'])<EOL>chart = self.__generate_chart(mask, properties)<EOL>sheet = properties['<STR_LIT>']<EOL>if sheet in self.sheet_dict.keys():<EOL><INDENT>self.sheet_dict[sheet] += <NUM_LIT:1><EOL>worksheet = self.workbook.get_worksheet_by_name(sheet)<EOL><DEDENT>else:<EOL><INDENT>self.sheet_dict[sheet] = <NUM_LIT:1><EOL>worksheet = self.workbook.add_worksheet(sheet)<EOL><DEDENT>worksheet.insert_chart('<STR_LIT>' % (<NUM_LIT:5> + (self.sheet_dict[sheet] - <NUM_LIT:1>) * <NUM_LIT>), chart)<EOL>
Function:
    Generate and save chart to specific sheet.
Input:
    sheet: If already exists, new chart will be added below.
           Otherwise, it would create a new sheet;
    x_axis: Specify x axis;
    y_axis: Specify y axis;
    series: Specify series;
    filters: dict type, use to filter useful data from original data;
    title: if None, the chart will create without title;
    x_axis_name: if None, use x_axis instead;
    y_axis_name: if None, use y_axis instead;