Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

前端渲染 k线图,bar图,地图,饼图,无法渲染,只有词云可以渲染 #19

Closed
developertqw2017 opened this issue May 13, 2018 · 5 comments

Comments

@developertqw2017
Copy link

这里时Django报错信息

[13/May/2018 16:39:03] "GET /options/simpleKLine/ HTTP/1.1" 500 17958
Internal Server Error: /options/simpleBar/
Traceback (most recent call last):
File "/home/tqw233/cycle/data/django-chartit/chart/lib/python3.5/site-packages/django/core/handlers/exception.py", line 35, in inner
response = get_response(request)
File "/home/tqw233/cycle/data/django-chartit/chart/lib/python3.5/site-packages/django/core/handlers/base.py", line 128, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/tqw233/cycle/data/django-chartit/chart/lib/python3.5/site-packages/django/core/handlers/base.py", line 126, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/tqw233/cycle/data/django-chartit/chart/lib/python3.5/site-packages/django/views/generic/base.py", line 69, in view
return self.dispatch(request, *args, **kwargs)
File "/home/tqw233/cycle/data/django-chartit/chart/lib/python3.5/site-packages/django/views/generic/base.py", line 89, in dispatch
return handler(request, *args, **kwargs)
File "/home/tqw233/cycle/data/django-chartit/chart/lib/python3.5/site-packages/django_echarts/views/frontend.py", line 12, in get
return JsonResponse(data=echarts_instance.options, safe=False)
File "/home/tqw233/cycle/data/django-chartit/chart/lib/python3.5/site-packages/django/http/response.py", line 509, in init
data = json.dumps(data, cls=encoder, **json_dumps_params)
File "/usr/lib/python3.5/json/init.py", line 237, in dumps
**kw).encode(obj)
File "/usr/lib/python3.5/json/encoder.py", line 198, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python3.5/json/encoder.py", line 256, in iterencode
return _iterencode(o, 0)
File "/home/tqw233/cycle/data/django-chartit/chart/lib/python3.5/site-packages/django/core/serializers/json.py", line 104, in default
return super().default(o)
File "/usr/lib/python3.5/json/encoder.py", line 179, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <pyecharts.echarts.label.NormalLabel object at 0x7f183e0ece10> is not JSON serializable
ERROR:django.request:Internal Server Error: /options/simpleBar/
Traceback (most recent call last):
File "/home/tqw233/cycle/data/django-chartit/chart/lib/python3.5/site-packages/django/core/handlers/exception.py", line 35, in inner
response = get_response(request)
File "/home/tqw233/cycle/data/django-chartit/chart/lib/python3.5/site-packages/django/core/handlers/base.py", line 128, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/tqw233/cycle/data/django-chartit/chart/lib/python3.5/site-packages/django/core/handlers/base.py", line 126, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/tqw233/cycle/data/django-chartit/chart/lib/python3.5/site-packages/django/views/generic/base.py", line 69, in view
return self.dispatch(request, *args, **kwargs)
File "/home/tqw233/cycle/data/django-chartit/chart/lib/python3.5/site-packages/django/views/generic/base.py", line 89, in dispatch
return handler(request, *args, **kwargs)
File "/home/tqw233/cycle/data/django-chartit/chart/lib/python3.5/site-packages/django_echarts/views/frontend.py", line 12, in get
return JsonResponse(data=echarts_instance.options, safe=False)
File "/home/tqw233/cycle/data/django-chartit/chart/lib/python3.5/site-packages/django/http/response.py", line 509, in init
data = json.dumps(data, cls=encoder, **json_dumps_params)
File "/usr/lib/python3.5/json/init.py", line 237, in dumps
**kw).encode(obj)
File "/usr/lib/python3.5/json/encoder.py", line 198, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python3.5/json/encoder.py", line 256, in iterencode
return _iterencode(o, 0)
File "/home/tqw233/cycle/data/django-chartit/chart/lib/python3.5/site-packages/django/core/serializers/json.py", line 104, in default
return super().default(o)
File "/usr/lib/python3.5/json/encoder.py", line 179, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <pyecharts.echarts.label.NormalLabel object at 0x7f183e0ece10> is not JSON serializable

@chfw
Copy link

chfw commented May 13, 2018

pip freeze

请给出你的版本信息

@developertqw2017
Copy link
Author

解决了 pyecharts 的版本降级到0.4.0

astroid==1.6.3
borax==1.0.3
coverage==4.5.1
Django==2.0.4
django-chartit==0.2.9
django-echarts==0.3.5
django-markup-deprecated==0.0.3
docutils==0.14
dukpy==0.2.0
flake8==3.5.0
future==0.16.0
isort==4.3.4
javascripthon==0.10
Jinja2==2.10
jupyter-echarts-pypkg==0.1.0
lazy-object-proxy==1.3.1
lml==0.0.2
macropy3==1.1.0b2
MarkupSafe==1.0
mccabe==0.6.1
Pillow==5.1.0
pycodestyle==2.3.1
pyecharts==0.4.0
pyecharts-javascripthon==0.0.6
pyecharts-jupyter-installer==0.0.3
pyflakes==1.6.0
Pygments==2.2.0
pylint==1.8.4
pytz==2018.4
requirements==0.1
six==1.11.0
wrapt==1.10.11

@chfw
Copy link

chfw commented May 13, 2018

0.5.3 应该也可以的

@kinegratii
Copy link
Owner

django-echarts 目前(最新 v0.3.x) 还不支持 pyecharts v0.5.x 。

参考: #18

@chfw
Copy link

chfw commented May 13, 2018

请参照我的解决方案试试

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants