具体脚本如下:
if(下拉参数2.getSelectedIndex() == 0){
//用户数
if(下拉参数1.getSelectedIndex() == 0 ){
//判断下拉列表参数是否需要覆盖
if(下拉列表参数1.getObjects()[0][0 != "注册用户数-总"){
下拉列表参数1.setObjects(metricList_total_user)
下拉列表参数1.setSelectedObjects(["注册用户数-总",STRING)
}
//绑定所选指标到趋势图
var select_cols = 下拉列表参数1.getSelectedObjects()
refreshChartCol(选项卡1.selIndex)
setChartCol(select_cols , 选项卡1.selIndex)
}else if(下拉参数1.getSelectedIndex() == 1){
//判断下拉列表参数是否需要覆盖
if(下拉列表参数1.getObjects()[0][0 != "开户用户数-美"){
下拉列表参数1.setObjects(metricList_us_user)
下拉列表参数1.setSelectedObjects(["开户用户数-美",STRING)
}
//绑定所选指标到趋势图
var select_cols = 下拉列表参数1.getSelectedObjects()
refreshChartCol(选项卡1.selIndex)
setChartCol(select_cols , 选项卡1.selIndex)
}else{
//判断下拉列表参数是否需要覆盖
if(下拉列表参数1.getObjects()[0][0 != "开户用户数-沙"){
下拉列表参数1.setObjects(metricList_sa_user)
下拉列表参数1.setSelectedObjects(["开户用户数-沙",STRING)
}
//绑定所选指标到趋势图
var select_cols = 下拉列表参数1.getSelectedObjects()
refreshChartCol(选项卡1.selIndex)
setChartCol(select_cols , 选项卡1.selIndex)
}
}else if(下拉参数2.getSelectedIndex() == 1){
//金额
if(下拉参数1.getSelectedIndex() == 0){
//判断下拉列表参数是否需要覆盖
if(下拉列表参数1.getObjects()[0][0 != "入资金额-总"){
下拉列表参数1.setObjects(metricList_total_banlance)
下拉列表参数1.setSelectedObjects(["入资金额-总",STRING)
}
//绑定所选指标到趋势图
var select_cols = 下拉列表参数1.getSelectedObjects()
refreshChartCol(选项卡1.selIndex)
setChartCol(select_cols , 选项卡1.selIndex)
}else if(下拉参数1.getSelectedIndex() == 1){
//判断下拉列表参数是否需要覆盖
if(下拉列表参数1.getObjects()[0][0 != "入资金额-美"){
下拉列表参数1.setObjects(metricList_us_banlance)
下拉列表参数1.setSelectedObjects(["入资金额-美",STRING)
}
//绑定所选指标到趋势图
var select_cols = 下拉列表参数1.getSelectedObjects()
refreshChartCol(选项卡1.selIndex)
setChartCol(select_cols , 选项卡1.selIndex)
}else{
//判断下拉列表参数是否需要覆盖
if(下拉列表参数1.getObjects()[0][0 != "入资金额-沙"){
下拉列表参数1.setObjects(metricList_sa_banlance)
下拉列表参数1.setSelectedObjects(["入资金额-沙",STRING)
}
//绑定所选指标到趋势图
var select_cols = 下拉列表参数1.getSelectedObjects()
refreshChartCol(选项卡1.selIndex)
setChartCol(select_cols , 选项卡1.selIndex)
}
}else{
//转化率
if(下拉参数1.getSelectedIndex() == 0){
//判断下拉列表参数是否需要覆盖
if(下拉列表参数1.getObjects()[0][0 != "开户转化率-总"){
下拉列表参数1.setObjects(metricList_total_ratio)
下拉列表参数1.setSelectedObjects(["开户转化率-总",STRING)
}
//绑定所选指标到趋势图
var select_cols = 下拉列表参数1.getSelectedObjects()
refreshChartCol(选项卡1.selIndex)
setChartCol(select_cols , 选项卡1.selIndex)
}else if(下拉参数1.getSelectedIndex() == 1){
//判断下拉列表参数是否需要覆盖
if(下拉列表参数1.getObjects()[0][0 != "开户转化率-美"){
下拉列表参数1.setObjects(metricList_us_ratio)
下拉列表参数1.setSelectedObjects(["开户转化率-美",STRING)
}
//绑定所选指标到趋势图
var select_cols = 下拉列表参数1.getSelectedObjects()
refreshChartCol(选项卡1.selIndex)
setChartCol(select_cols , 选项卡1.selIndex)
}else{
//判断下拉列表参数是否需要覆盖
if(下拉列表参数1.getObjects()[0][0 != "开户转化率-沙"){
下拉列表参数1.setObjects(metricList_sa_ratio)
下拉列表参数1.setSelectedObjects(["开户转化率-沙",STRING)
}
//绑定所选指标到趋势图
var select_cols = 下拉列表参数1.getSelectedObjects()
refreshChartCol(选项卡1.selIndex)
setChartCol(select_cols , 选项卡1.selIndex)
}
}
function refreshChartCol(index){
if(index == 0){
当日趋势图.binding.clearYCols()
}else if (index == 1){
新户趋势图.binding.clearYCols()
}else if (index == 2){
首次趋势图.binding.clearYCols()
}
}
function setChartCol(select_col, index){
for( i = 0; i < select_col.length; i++){
var bcol = new BCol(select_col[i, DOUBLE, false)
var qcol = new ChartMeasureCol(NONE, bcol, null)
if(index == 0){
当日趋势图.binding.addYCol(i, qcol)
当日趋势图.binding.axis[select_col[i.shareGroup = "group_today"
}else if (index == 1){
新户趋势图.binding.addYCol(i, qcol)
新户趋势图.binding.axis[select_col[i.shareGroup = "group_new"
}else if (index == 2){
首次趋势图.binding.addYCol(i, qcol)
首次趋势图.binding.axis[select_col[i.shareGroup = "group_first"
}
}
if(select_col.length > 1){
if(index == 0){
当日趋势图.binding.axis[select_col[0.axisPosition = -1
}else if (index == 1){
新户趋势图.binding.axis[select_col[0.axisPosition = -1
}else if (index == 2){
首次趋势图.binding.axis[select_col[0.axisPosition = -1
}
}
}
|