有一些方法可以在地图类型的图表中设置初始缩放吗?
我有这个选择:
m.setOption({
tooltip : {
trigger: 'item'
},
toolbox: {
show : true,
orient : 'vertical',
x: 'right',
y: 'center',
feature : {
mark : {show: true},
dataView : {show: true, readOnly: false},
restore : {show: true},
saveAsImage : {show: true}
}
},
asoluteZoom : {start : 90, end : 100},
series : [
{
name: 'Name',
type: 'map',
mapType: 'world',
hoverable: false,
roam:true,
data : [],
markPoint : {
symbolSize: 10,
itemStyle: {
normal: {
borderColor: '#87cefa',
borderWidth: 1,
label: {
show: false
}
},
emphasis: {
borderColor: '#1e90ff',
borderWidth: 5,
label: {
show: false
}
}
},
data : [
{name: "Hello!"},
]
},
geoCoord: {
"Hello!":[-4.729075, 37.906475],
}
}
]
});
我尝试使用 asoluteZoom ,但没有任何反应。
答案 0 :(得分:1)
我解决了: scaleLimit 解释here
答案 1 :(得分:0)
您可以按照以下方式执行此操作,
var aryDictData = [[String:AnyObject]]()
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
var aryOptionName = [String]()
var strOptionName = String()
var cell = DeliveryTableViewCell()
cell = tableView.dequeueReusableCell(withIdentifier: "DeliveryTableViewCell") as! DeliveryTableViewCell
cell.selectionStyle = .none
let productPrice = userDefault.object(forKey: ProductDesConstantNames.KAryStorePrices) as! [String]
if indexPath.section == 0{
if indexPath.row < (aryDictData[0]["storeName"]!).count{
cell.lblItemName.text = ((aryDictData[0]["storeName"]! as AnyObject)[indexPath.row] as! String)
cell.lblPrice.text = "$\(String(((Double(productPrice[indexPath.row])! + grandTotalProductPrice[indexPath.row]) * Double(numQuntity))))"
cell.lblItemQuantity.text = "\(numQuntity)x"
cell.lblItemQuantity.textColor = UIColor.init(red: 41/255, green: 144/255, blue: 85/255, alpha: 1.0)
let data = aryPreviewOrder[indexPath.row] as! [[String:AnyObject]]
print(data)
for i in 0..<((aryDictData[0]["options"]! as AnyObject)[indexPath.row]! as AnyObject).count {
let optionName = ((((aryDictData[0]["options"]! as AnyObject)[indexPath.row]! as AnyObject)[i] as AnyObject)["option_name"] as! String)
let prices = ((((aryDictData[0]["options"]! as AnyObject)[indexPath.row]! as AnyObject)[i] as AnyObject)["price"] as! String)
aryOptionName.append("\(optionName) ($\(prices))")
// aryOptionPrices.append("($\(prices))")
strOptionName = aryOptionName.joined(separator: "\n")
// strOptionPrice = aryOptionPrices.joined(separator: "\n")
}
cell.lblOptionNames.text = strOptionName
}
}
}
return cell
}
答案 2 :(得分:0)
使用系列对象的 zoom 属性。