mirror of
https://github.com/pyecharts/pyecharts.git
synced 2025-12-08 20:59:23 +00:00
* ♻️ Import pyecharts_javascripthon as a subpackage * ♻️ Refactor py2js translator (Alpha) * 🐛 Fix errors * 🔧 Remove py34 travis build * ✅ Update tests * ⬆️ Fix build * ⬆️ Fix build * ♻️ Add __pye_json__ protocol * ♻️ Rename class name * ♻️ Use __json__ protocol * ♻️ Refactor MyJSONEncoder interface * ♻️ Refactor class * 🎨 Use api module * 📝 Update docs * 🎨 Refactor imports * 💚 Fix import errors * ✨ Add JSONSerializableMixin interface * 📝 Add release note * 📝 Update release-note * 🚨 Fix lint error * Format: format code and docs * Update: micro update * ♻️ Refactor module classes * 🐛 Fix pandas data encode
21 lines
555 B
Python
21 lines
555 B
Python
#!/usr/bin/env python
|
|
# coding=utf-8
|
|
from __future__ import unicode_literals
|
|
|
|
import pyecharts.echarts.events as events
|
|
from pyecharts import Bar
|
|
from pyecharts.javascripthon.dom import alert
|
|
|
|
|
|
def on_click():
|
|
alert("点击事件触发")
|
|
|
|
|
|
def test_mouse_click():
|
|
bar = Bar("我的第一个图表", "这里是副标题")
|
|
bar.add(
|
|
"服装", ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"], [5, 20, 36, 10, 75, 90]
|
|
)
|
|
bar.on(events.MOUSE_CLICK, on_click)
|
|
assert "function on_click(" in bar._repr_html_()
|