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

echarts地图内纹理填充 #5429

Closed
duanhaowei opened this issue Apr 5, 2017 · 20 comments
Closed

echarts地图内纹理填充 #5429

duanhaowei opened this issue Apr 5, 2017 · 20 comments

Comments

@duanhaowei
Copy link

duanhaowei commented Apr 5, 2017

One-line summary [问题简述]

使用geo进行地图纹理填充,首先使用api里例子
geo.itemStyle.normal.color:new echarts.graphic.Pattern(
imageDom, // 支持为 HTMLImageElement, HTMLCanvasElement,不支持路径字符串
'repeat' // 是否平铺, 可以是 repeat-x, repeat-y, no-repeat
)
提示echarts.graphic.Pattern不存在,引入的是最新版的js包。

然后使用json方式可以填充,然而填充后纹理不正常,呈现模糊话,可能是背景没有被repeat造成的。

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: 3.5.1
  • Browser version [浏览器类型和版本]: chrome56
  • OS Version [操作系统类型和版本]:w10

Expected behaviour [期望结果]

ECharts option [ECharts配置项]

var piePatternSrc = 'base64编码太长了,你们自己补一个到这里。';

var piePatternImg = new Image();
piePatternImg.src = piePatternSrc;
var bgPatternImg = new Image();
bgPatternImg.src = bgPatternSrc;

option = {

geo: {
    map: 'china',
    itemStyle: {
        normal: {
            borderColor: '#000',
            color: {
                    image: piePatternImg,
                    repeat: 'repeat'
                },
        },

    }
},

};

Other comments [其他信息]

@duanhaowei
Copy link
Author

@pissang 大神方便指教一下吗?

@mangoZT
Copy link

mangoZT commented Apr 6, 2017

同问,在其他饼图等都是正常显示,在地图中会放大模糊 不过我没有使用geo,我是在具体数据项设置itemstyle 因为每个省的图形纹理不同 结果都是模糊 是需要进行其他设置么@pissang

@mangoZT
Copy link

mangoZT commented Apr 7, 2017

@duanhaowei 朋友有研究出来结果么

@mangoZT
Copy link

mangoZT commented Apr 7, 2017

9iw 6v 62lxaiv8s wy n
image
饼图可以正常设置 地图就会变形模糊@pissang

@duanhaowei
Copy link
Author

@mangoZT 没有啊兄弟,普通cavans纹理填充是可以的。我怀疑这个要看echarts源码了,应该是处于优化考虑肯定在里面做了处理。

@dantelife
Copy link

@duanhaowei 哥们, 地图纹理填充解决了吗?

@pissang pissang added the pending We are not sure about whether this is a bug/new feature. label Jun 30, 2017
@duanhaowei
Copy link
Author

@dantelife 没有,无法解决,于是我换了其他的方案。

@dantelife
Copy link

@duanhaowei 什么方案,方便告知吗?

@gaojinbo010
Copy link

@duanhaowei 可以分享下么

@duanhaowei
Copy link
Author

@dantelife @gaojinbo010 才看到通知,我记得上次的解决方案是放弃背景填充,让他背景透明,然后底下垫上一层DIV假装他有背景。

@dantelife
Copy link

@pissang 你好,请问这个bug,你们计划什么时候修复?

@xushimin
Copy link

xushimin commented Mar 5, 2018

图片填充是将整个地图都进行填充,不是特定区域,所以看起来是模糊的,但是也不知道整个地图填充的规律是什么

@eeeqxxtg
Copy link

eeeqxxtg commented Aug 2, 2018

scatter 纹理填充也是这个模糊的样子

@nuxio
Copy link

nuxio commented Oct 21, 2018

@pissang 4.2 版本也没有修复这个问题呢,有空解决一下吗?

@LittleBreak
Copy link

遇到同样的问题,很尴尬

1 similar comment
@pearlwang1106
Copy link

遇到同样的问题,很尴尬

@Ovilia
Copy link
Contributor

Ovilia commented Sep 20, 2019

This problem has been fixed in #11272 .
test/geoScatter.html shows an example of how to use it.

@coderxsjah
Copy link

请问,纹理填充时,UV映射规律是怎么样的呀?是像CSS里一样,取同一像素位置的值使用吗

@coderxsjah
Copy link

实验出来了,其实就是把背景图按照原本大小放在平面上,然后echarts的geo框到哪部分,那部分就作为背景
image

@zhouzhili
Copy link

实验出来了,其实就是把背景图按照原本大小放在平面上,然后echarts的geo框到哪部分,那部分就作为背景 image

这个示例能发下吗?纹理好难配

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

No branches or pull requests