<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def kline_echarts(self, code=None):
 def kline_formater(param):
 return param.name + ':' + vars(param) """plot the market_data"""

        if code is None:
            path_name = '.' + os.sep + 'QA_' + self.type + \
                '_codepackage_' + self.if_fq + '.html'
            kline = Kline(
                'CodePackage_' + self.if_fq + '_' + self.type,
                width=1360,
                height=700,
                page_title='QUANTAXIS'
            )

            bar = Bar()
            data_splits = self.splits()

            for ds in data_splits:
                data = []
                axis = []
                if ds.type[-3:] == 'day':
                    datetime = np.array(ds.date.map(str))
                else:
                    datetime = np.array(ds.datetime.map(str))
                ohlc = np.array(
                    ds.data.loc[:,
                                ['open',
                                 'close',
                                 'low',
                                 'high']]
                )

                kline.add(
                    ds.code[0],
                    datetime,
                    ohlc,
                    mark_point=["max",
                                "min"],
                    is_datazoom_show=True,
                    datazoom_orient='horizontal'
                )
            return kline

        else:
            data = []
            axis = []
            ds = self.select_code(code)
            data = []
            #axis = []
            if self.type[-3:] == 'day':
                datetime = np.array(ds.date.map(str))
            else:
                datetime = np.array(ds.datetime.map(str))

            ohlc = np.array(ds.data.loc[:, ['open', 'close', 'low', 'high']])
            vol = np.array(ds.volume)
            kline = Kline(
                '{}__{}__{}'.format(code,
                                    self.if_fq,
                                    self.type),
                width=1360,
                height=700,
                page_title='QUANTAXIS'
            )
            bar = Bar()
            kline.add(self.code, datetime, ohlc,
                      mark_point=["max", "min"],
                      # is_label_show=True,
                      is_datazoom_show=True,
                      is_xaxis_show=False,
                      # is_toolbox_show=True,
                      tooltip_formatter='{b}:{c}',  # kline_formater,
                      # is_more_utils=True,
                      datazoom_orient='horizontal')

            bar.add(
                self.code,
                datetime,
                vol,
                is_datazoom_show=True,
                datazoom_xaxis_index=[0,
                                      1]
            )

            grid = Grid(width=1360, height=700, page_title='QUANTAXIS')
            grid.add(bar, grid_top="80%")
            grid.add(kline, grid_bottom="30%")
            return grid