def _create_ratio_visualization(job, args):
        """
        Args:
            job: fedlearner_webconsole.job.models.Job. Current job to plot.
            args: dict. reqparse args, must contain 'numerator' and
                'denominator' entries, and the values must not be None.
                args['numerator'] and args['denominator'] should respectively be
                a valid Lucene query string.

        Returns:
            dict. A Kibana vis state dict

        This method will create 3 time series and stack them in vis state.
        """
        for k in ('numerator', 'denominator'):
            if k not in args or args[k] is None:
                raise ValueError(
                    '[{}] should be provided in Ratio visualization'.format(k)
                )
        vis_state = Kibana._basic_tsvb_vis_state(job, args)
        params = vis_state['params']
        # Denominator series
        denominator = Kibana._tsvb_series(
            label=args['denominator'],
            metrics={'type': 'count'},
            series_filter={'query': args['denominator']}
        )
        # Numerator series
        numerator = Kibana._tsvb_series(
            label=args['numerator'],
            metrics={'type': 'count'},
            series_filter={'query': args['numerator']}
        )
        # Ratio series
        ratio = Kibana._tsvb_series(
            series_type='ratio',
            label='Ratio',
            metrics={'numerator': args['numerator'],
                     'denominator': args['denominator'],
                     'type': 'filter_ratio'},
            line_width='2',
            fill='0'
        )
        series = [denominator, numerator, ratio]
        for series_, color in zip(series, Kibana.COLORS[1::2]):
            series_['color'] = color
        params['series'] = series
        return vis_state

        Args:
            job: fedlearner_webconsole.job.models.Job. Current job to plot.
            args: dict. reqparse args, must contain 'numerator' and
                'denominator' entries, and the values must not be None.
                args['numerator'] and args['denominator'] should respectively be
                a valid Lucene query string.

        Returns:
            dict. A Kibana vis state dict

        This method will create 3 time series and stack them in vis state.
        
web_console_v2/api/fedlearner_webconsole/utils/kibana.py