有种json对象要大量使用,所以想封装成对象,
{tooltip : {
trigger: 'axis',
axisPointer: {type: 'cross',},
formatter: "{b}: {c})"},
xAxis :{
type : 'category',
data : ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
axisTick: {alignWithLabel: true}},
yAxis :{
type : 'value'},
series :{
type:'bar',
barWidth: '80%',
data:[10, 52, 200, 334, 390, 330, 220]}}
现在的想法是一层对象再套一层tooltip,xAxis,series对象,可是完全偏离目标了,本来就只是一个辅助对象。有没有什么好的做法?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
输出: