Exemple #1
0
        def make_document(doc: Document):
            doc.title = "Backtrader Optimization Result"

            env = Environment(
                loader=PackageLoader('backtrader_plotting.bokeh', 'templates'))
            doc.template = env.get_template("basic.html.j2")

            doc.template_variables['stylesheet'] = utils.generate_stylesheet(
                self._bokeh.params.scheme)

            model = self._build_optresult_model()
            doc.add_root(model)
Exemple #2
0
        def make_document(doc: Document):
            if self._on_session_destroyed is not None:
                doc.on_session_destroyed(self._on_session_destroyed)

            # set document title
            doc.title = self._title

            # set document template
            env = Environment(loader=PackageLoader('backtrader_plotting.bokeh', 'templates'))
            doc.template = env.get_template(self._html_template)
            doc.template_variables['stylesheet'] = utils.generate_stylesheet(self._scheme)

            # get root model
            model = self._model_factory_fnc(doc)
            doc.add_root(model)
 def _output_stylesheet(self, template="basic.css.j2"):
     return generate_stylesheet(self.p.scheme, template)