【问题标题】:Changing the hover box values in Pygal/Python在 Pygal/Python 中更改悬停框值
【发布时间】:2017-12-02 21:29:33
【问题描述】:

我使用 Pygal 库在 Python 中创建了一个散点图。现在,我想更改当您将鼠标悬停在框上时显示的框内的信息(我认为它称为 dynamic_print_values ???)。我希望能够在其中写一个解释。

【问题讨论】:

    标签: python hover pygal


    【解决方案1】:

    不确定你是否解决了这个问题,但试试这个。

    chart = pygal.XY()
    chart.add('First', [{'value': (2,0.1), 'label': 'This is the first'},
                        {'value': (2.6,0.4), 'label': 'This is the second'},
                        {'value': (3.6,0.8), 'label': 'This is the third'}])
    chart.render_to_file('testpy.svg')
    

    在值/系列列表中,将您的值替换为字典项,按照上述示例指定“值”和“标签”。

    【讨论】:

      猜你喜欢
      • 2021-05-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-05
      • 2023-04-07
      • 2011-02-22
      • 1970-01-01
      相关资源
      最近更新 更多