如何在Mac OS X上的ipython中进行pygal图的悬停动画 [英] how to get on hover animation of pygal graphs in ipython on mac osx

查看:73
本文介绍了如何在Mac OS X上的ipython中进行pygal图的悬停动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在用pip安装CairoSVG和用自制软件安装Cairo之后,我才刚开始在ipython中使用pygal.

图形呈现,但是当我将鼠标悬停在图形上时,没有交互性(例如,在条形图上显示单个条形的频率)?

要实现与Pygal文档中相同的翻转/悬停功能,我需要安装什么?

http://www.pygal.org/en/latest/documentation/first_steps.html

例如,当您单击图形上的图例项时,该图例项将变灰并隐藏.再次单击图例项将使其返回.当我在Ipython中创建示例第一步"代码并单击图例项时,它不会消失.

解决方案

我遇到了同样的问题,但是在检查了git上的代码后,更好的解决方案是不更改config.py文件,而是添加

force_uri_protocol='https'

作为渲染功能的参数,例如

chart.render_to_file(output_file, force_uri_protocol='https')

I have just started using pygal in ipython after installing CairoSVG with pip and Cairo with homebrew.

The graphs render but when I hover over them there is no interactivity (displaying the frequency for a single bar on a bar graph for example)?

What do I need to install to achieve the same rollover/hover functionality that can be seen in the Pygal Documentation?

http://www.pygal.org/en/latest/documentation/first_steps.html

For example when you click on a legend item on a graph, the legend item is greyed out and hidden. Clicking the legend item again makes it return. When I create the sample First Steps code in Ipython and click on a legend item it doesn't disappear.

解决方案

I had the same problem, but after checking the code on git, the better solution would be not to change the config.py file, but instead add

force_uri_protocol='https'

as a parameter to your rendering function, e.g.

chart.render_to_file(output_file, force_uri_protocol='https')

这篇关于如何在Mac OS X上的ipython中进行pygal图的悬停动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆