x轴为Time类型时,柱状图可以进行堆积吗?
如这样的代码,页面不显示,也不提示错误: option = { tooltip : { trigger: 'axis', axisPointer : { // 坐标轴指示器,坐标轴触发有效 type : 'shadow' // 默认为直线,可选为:'line' | 'shadow' } }, legend: { data:['直接访问','邮件营销','联盟广告','视频广告','搜索引擎','百度','谷歌','必应','其他'] }, toolbox: { show : true, orient: 'vertical', x: 'right', y: 'center', feature : { mark : {show: true}, dataView : {show: true, readOnly: false}, magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']}, restore : {show: true}, saveAsImage : {show: true} } }, calculable : true, xAxis : [ { type : 'time',
}
],
yAxis : [
{
type : 'value'
}
],
series : [
{
name:'百度',
type:'bar',
barWidth : 15,
stack: '搜索引擎',
data:[[new Date("2014-01-01"),620],[new Date("2014-01-02"),732]]
},
{
name:'谷歌',
type:'bar',
stack: '搜索引擎',
data:[[new Date("2014-01-01"),120] ,[new Date("2014-01-01"),132]]
}
]
};
柱状图和折线图是联动效果,折线图x轴就用的time 类型,所以跟着一起用的time类型。 这样有办法解决方案?
非类目型数值是不能堆叠的,允许不连续,而且细分粒度也无法对齐
噢 , 这样。 那对于 markPoint ,的x轴 也只能支持 类目类型?
markPoint xAxis 可以指定 new Date("时间字符串") ,刚试的,如下: markPoint : { symbol: 'star', //symbolSize:20, itemStyle:{ normal:{label:{position:'top'}} }, data : [ {name : '政策文件', value : "测试", xAxis: new Date('2014-11-18'), y: 60} ] } 。就是y 和 yAxis 不能给固定在y轴最顶上。 只能靠试y 的值和百分比来定位。
你会想到办法的。