You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2020/04/05 16:48:52 UTC
[GitHub] [incubator-echarts] travis1111 commented on issue #12357: 保存力引导布局graph options 成JSON,重新setOption 报错
travis1111 commented on issue #12357: 保存力引导布局graph options 成JSON,重新setOption 报错
URL: https://github.com/apache/incubator-echarts/issues/12357#issuecomment-609446415
谢谢!但是有两个问题
1. 这个layout 跟viewport 有很大关系,比如我第一次layout完后,存了数据,然后把浏览器窗口大小改变一下,再load 进去,graph 的比例就不一样了,像是被压扁了一样。
2. 另外一个办法我想到的就是用convertToPixel 存当前canvas 大小及像素点,然后重新load 的时候根据新的屏幕大小,调整像素位置,然后在convertFromPixel 写成layout。可以第一步就不对,我用下面的方法返回的跟送进去的一样:
```sh
var obj = chart.convertToPixel({seriesIndex:0},[958.004150390625, 349.3768310546875]);
console.log(obj);
```
返回还是
```sh
958.004150390625, 349.3768310546875
```
是我用错了吗?
我的 `coordinateSystem` 没有设定。设定任何其他的都不对。`layout` 是 `force`。
谢谢
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org