提交 3c060e59 编写于 作者: P pah100

Merge branch 'master' of https://github.com/pissang/echarts-next

......@@ -77,7 +77,7 @@ define(function (require) {
// mapValueCalculation: 'sum',
// 地图数值计算结果小数精度
// mapValuePrecision: 0,
// 显示图例颜色标识(系列标识的小圆点)
// 显示图例颜色标识(系列标识的小圆点),图例开启时有效
showLegendSymbol: true,
// 选择模式,默认关闭,可选single,multiple
// selectedMode: false,
......@@ -90,9 +90,10 @@ define(function (require) {
itemStyle: {
normal: {
// color: 各异,
borderWidth: 0,
borderWidth: 0.5,
borderColor: '#444',
areaStyle: {
color: '#ccc'
color: '#eee'
},
label: {
show: false,
......@@ -104,7 +105,6 @@ define(function (require) {
// 也是选中样式
emphasis: {
// color: 各异,
borderWidth: 0,
areaStyle: {
color: 'rgba(255,215,0,0.8)'
},
......
......@@ -13,7 +13,7 @@ define(function (require) {
mapModel.needsDrawMap &&
this._renderArea(mapModel, ecModel, api);
mapModel.get('showLegendSymbol')
mapModel.get('showLegendSymbol') && ecModel.getComponent('legend')
&& this._renderSymbols(mapModel, ecModel, api);
},
......@@ -27,8 +27,9 @@ define(function (require) {
group.add(mapGroup);
var scale = geo.scale;
mapGroup.position = geo.position.slice();
mapGroup.scale = geo.scale.slice();
mapGroup.scale = scale.slice();
zrUtil.each(geo.regions, function (region) {
......@@ -58,6 +59,9 @@ define(function (require) {
itemStyle
);
styleObj.lineWidth && (styleObj.lineWidth /= scale[0]);
hoverItemStyle.lineWidth && (hoverItemStyle.lineWidth /= scale[0]);
zrUtil.each(region.contours, function (contour) {
var polygon = new graphic.Polygon({
......
......@@ -17,7 +17,9 @@ define(function (require) {
z: 0,
center: ['50%', '50%'],
x: 'center',
y: 'center',
width: '70%',
......
......@@ -14,14 +14,12 @@ define(function (require) {
* @param {module:echarts/ExtensionAPI} api
*/
var resizeGeo = function (locModel, api) {
var center;
if (locModel.type === 'series.map') {
locModel = locModel.getModel('mapLocation');
center = [locModel.get('x'), locModel.get('y')];
}
else {
center = locModel.get('center');
}
var x = locModel.get('x');
var y = locModel.get('y');
var width = locModel.get('width');
var height = locModel.get('height');
......@@ -29,8 +27,9 @@ define(function (require) {
var viewHeight = api.getHeight();
var parsePercent = numberUtil.parsePercent;
var cx = parsePercent(center[0], viewWidth);
var cy = parsePercent(center[1], viewHeight);
var cx = parsePercent(x, viewWidth);
var cy = parsePercent(y, viewHeight);
width = parsePercent(width, viewWidth);
height = parsePercent(height, viewHeight);
......@@ -44,6 +43,29 @@ define(function (require) {
width = rect.width / rect.height * height;
}
// Special position
// FIXME
switch (x) {
case 'center':
break;
case 'right':
cx -= width;
break;
default:
cx += width / 2;
break;
}
switch (y) {
case 'center':
break;
case 'bottom':
cy -= height;
break;
default:
cy += height / 2;
break;
}
this.transformTo(cx, cy, width, height);
}
......
......@@ -45,7 +45,6 @@ define(function(require) {
*/
layout.hbox = zrUtil.curry(boxLayout, 'horizontal');
/**
* Position group of component in viewport
* Group position is specified by either
......
......@@ -16,14 +16,14 @@
require([
'echarts',
'geoJson/world_geo',
'geoJson/china_geo',
'echarts/chart/scatter',
'echarts/component/legend',
'echarts/component/geo'
], function (echarts, worldJson) {
], function (echarts, chinaJson) {
echarts.registerMap('world', worldJson);
echarts.registerMap('china', chinaJson);
var placeList = [
{name:'海门', geoCoord:[121.15, 31.89]},
......@@ -252,7 +252,7 @@
data: ['scatter', 'scatter2']
},
geo: {
map: 'world'
map: 'china'
},
tooltip: {
trigger: 'axis',
......
......@@ -33,14 +33,16 @@
var itemStyle = {
normal:{
borderWidth: 0.5,
borderColor: 'black',
label:{show:true}
},
emphasis:{
label:{show:true},
shadowOffsetX: 0,
shadowOffsetY: 0,
shadowBlur: 20,
shadowColor: 'rgba(0, 0, 0, 0.3)'
// shadowOffsetX: 0,
// shadowOffsetY: 0,
// shadowBlur: 20,
// shadowColor: 'rgba(0, 0, 0, 0.3)'
}
}
......@@ -75,7 +77,8 @@
type: 'map',
mapType: 'world',
mapLocation: {
// y : 60
y : 60,
width: '80%'
},
itemStyle: itemStyle,
data:[
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册