mirror of
https://github.com/pyecharts/pyecharts.git
synced 2026-01-25 17:06:27 +00:00
33 lines
892 B
Python
33 lines
892 B
Python
from nose.tools import eq_
|
|
|
|
from pyecharts import options as opts
|
|
from pyecharts.charts import Kline
|
|
|
|
data = [
|
|
[2320.26, 2320.26, 2287.3, 2362.94],
|
|
[2300, 2291.3, 2288.26, 2308.38],
|
|
[2295.35, 2346.5, 2295.35, 2345.92],
|
|
[2347.22, 2358.98, 2337.35, 2363.8],
|
|
[2360.75, 2382.48, 2347.89, 2383.76],
|
|
[2383.43, 2385.42, 2371.23, 2391.82],
|
|
[2377.41, 2419.02, 2369.57, 2421.15],
|
|
[2425.92, 2428.15, 2417.58, 2440.38],
|
|
[2411, 2433.13, 2403.3, 2437.42],
|
|
[2432.68, 2334.48, 2427.7, 2441.73],
|
|
]
|
|
|
|
|
|
def test_kline_base():
|
|
c = (
|
|
Kline()
|
|
.add_xaxis(["2017/7/{}".format(i + 1) for i in range(10)])
|
|
.add_yaxis("kline", data)
|
|
.set_global_opts(
|
|
yaxis_opts=opts.AxisOpts(is_scale=True),
|
|
xaxis_opts=opts.AxisOpts(is_scale=True),
|
|
)
|
|
)
|
|
eq_(c.theme, "white")
|
|
eq_(c.renderer, "canvas")
|
|
c.render()
|