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

x轴为Time类型时,柱状图可以进行堆积吗? #1084

Closed
spp1987 opened this issue Dec 26, 2014 · 5 comments
Closed

x轴为Time类型时,柱状图可以进行堆积吗? #1084

spp1987 opened this issue Dec 26, 2014 · 5 comments

Comments

@spp1987
Copy link

spp1987 commented Dec 26, 2014

如这样的代码,页面不显示,也不提示错误:
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]]
    }

]

};

@spp1987
Copy link
Author

spp1987 commented Dec 26, 2014

柱状图和折线图是联动效果,折线图x轴就用的time 类型,所以跟着一起用的time类型。 这样有办法解决方案?

@kener
Copy link
Contributor

kener commented Dec 26, 2014

非类目型数值是不能堆叠的,允许不连续,而且细分粒度也无法对齐

@spp1987
Copy link
Author

spp1987 commented Dec 26, 2014

噢 , 这样。
那对于 markPoint ,的x轴 也只能支持 类目类型?

@spp1987
Copy link
Author

spp1987 commented Dec 26, 2014

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 的值和百分比来定位。

@kener
Copy link
Contributor

kener commented Jan 4, 2015

你会想到办法的。

@kener kener closed this as completed Jan 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants