<i id='PP9UU'><tr id='PP9UU'><dt id='PP9UU'><q id='PP9UU'><span id='PP9UU'><b id='PP9UU'><form id='PP9UU'><ins id='PP9UU'></ins><ul id='PP9UU'></ul><sub id='PP9UU'></sub></form><legend id='PP9UU'></legend><bdo id='PP9UU'><pre id='PP9UU'><center id='PP9UU'></center></pre></bdo></b><th id='PP9UU'></th></span></q></dt></tr></i><div id='PP9UU'><tfoot id='PP9UU'></tfoot><dl id='PP9UU'><fieldset id='PP9UU'></fieldset></dl></div>

        <small id='PP9UU'></small><noframes id='PP9UU'>

          <bdo id='PP9UU'></bdo><ul id='PP9UU'></ul>

        <legend id='PP9UU'><style id='PP9UU'><dir id='PP9UU'><q id='PP9UU'></q></dir></style></legend>

      1. <tfoot id='PP9UU'></tfoot>
      2. Plotly:带有“href"的树形图元素不工作

        Plotly: treemap element with quot;hrefquot; not working(Plotly:带有“href的树形图元素不工作)
      3. <tfoot id='0BUy4'></tfoot>

        <small id='0BUy4'></small><noframes id='0BUy4'>

            <tbody id='0BUy4'></tbody>

          • <bdo id='0BUy4'></bdo><ul id='0BUy4'></ul>
            <legend id='0BUy4'><style id='0BUy4'><dir id='0BUy4'><q id='0BUy4'></q></dir></style></legend>

                <i id='0BUy4'><tr id='0BUy4'><dt id='0BUy4'><q id='0BUy4'><span id='0BUy4'><b id='0BUy4'><form id='0BUy4'><ins id='0BUy4'></ins><ul id='0BUy4'></ul><sub id='0BUy4'></sub></form><legend id='0BUy4'></legend><bdo id='0BUy4'><pre id='0BUy4'><center id='0BUy4'></center></pre></bdo></b><th id='0BUy4'></th></span></q></dt></tr></i><div id='0BUy4'><tfoot id='0BUy4'></tfoot><dl id='0BUy4'><fieldset id='0BUy4'></fieldset></dl></div>

                  本文介绍了Plotly:带有“href"的树形图元素不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  I have simple table whin href link inside the text. But clicking on it doesn't open the page. is there any easy way to do that?

                  import plotly.express as px
                  df = px.data.gapminder().query("year == 2007")
                  
                  link_ref = '<a xlink:href="http://google.com" style="cursor: pointer" target="_blank" rel="noopener noreferrer">{}</a>'
                  df['country'] = df['country'].apply(lambda item: link_ref.format(item, "{}"))
                  
                  fig = px.treemap(df, path=[ 'continent', 'country'], values='pop',
                                    color='lifeExp', hover_data=['iso_alpha'])
                  fig.show()
                  

                  解决方案

                  You just need to get rid of xlink: The following should work

                  import plotly.express as px
                  df = px.data.gapminder().query("year == 2007")
                  
                  link_ref = '<a href="http://google.com" style="cursor: pointer" target="_blank" rel="noopener noreferrer">{}</a>'
                  df['country'] = df['country'].apply(lambda item: link_ref.format(item, "{}"))
                  
                  fig = px.treemap(df,
                                   path=[ 'continent', 'country'],
                                   values='pop',
                                   color='lifeExp',
                                   hover_data=['iso_alpha'])
                  
                  fig.show()
                  

                  这篇关于Plotly:带有“href"的树形图元素不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Adding config modes to Plotly.Py offline - modebar(将配置模式添加到 Plotly.Py 离线 - 模式栏)
                  Plotly: How to style a plotly figure so that it doesn#39;t display gaps for missing dates?(Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙?)
                  python save plotly plot to local file and insert into html(python将绘图保存到本地文件并插入到html中)
                  Plotly: What color cycle does plotly express follow?(情节:情节表达遵循什么颜色循环?)
                  How to save plotly express plot into a html or static image file?(如何将情节表达图保存到 html 或静态图像文件中?)
                  Plotly: How to make a line plot from a pandas dataframe with a long or wide format?(Plotly:如何使用长格式或宽格式的 pandas 数据框制作线图?)
                  • <tfoot id='GsGI8'></tfoot>

                        <bdo id='GsGI8'></bdo><ul id='GsGI8'></ul>

                        <i id='GsGI8'><tr id='GsGI8'><dt id='GsGI8'><q id='GsGI8'><span id='GsGI8'><b id='GsGI8'><form id='GsGI8'><ins id='GsGI8'></ins><ul id='GsGI8'></ul><sub id='GsGI8'></sub></form><legend id='GsGI8'></legend><bdo id='GsGI8'><pre id='GsGI8'><center id='GsGI8'></center></pre></bdo></b><th id='GsGI8'></th></span></q></dt></tr></i><div id='GsGI8'><tfoot id='GsGI8'></tfoot><dl id='GsGI8'><fieldset id='GsGI8'></fieldset></dl></div>

                        <small id='GsGI8'></small><noframes id='GsGI8'>

                            <legend id='GsGI8'><style id='GsGI8'><dir id='GsGI8'><q id='GsGI8'></q></dir></style></legend>
                              <tbody id='GsGI8'></tbody>