【问题标题】:Birt: change the dimension of chart through scriptBirt:通过脚本改变图表的维度
【发布时间】:2014-07-26 02:10:36
【问题描述】:

谁能告诉我如何在Birt中通过javascript更改图表的维度。我尝试了下面的方法,但是在我将下面的脚本放入图表的前生成事件后,图表完全消失了

function beforeGeneration( chart, icsc )
{
    yAxis = chart.getAxes()[0].getAssociatedAxes()[0];
    seriesDef = yAxis.getSeriesDefinitions()[0];
    for(i=0;i<seriesDef.getSeries().size();i++)
    {   
        if(seriesDef.getSeries()[i].getSeriesIdentifier() == "My Town")
        {       
            ds = seriesDef.getSeries()[i].getDataSet(); 
        }
    }
    ns = BarSeriesImpl.create();
    ns.setDataSet(ds);
    ns.setSeriesIdentifier("My Town");
    seriesDef.getSeries().add(ns);
    seriesDef.getSeries().move(0,ns);
    setDimension(TWO_DIMENSIONAL_WITH_DEPTH_LITERAL);

}

整个功能都在工作。我面临的唯一问题是将图表类型更改为具有深度的 2D。我对以下语法有疑问

setDimension(TWO_DIMENSIONAL_WITH_DEPTH_LITERAL);

任何帮助将不胜感激

阿里夫

【问题讨论】:

    标签: javascript birt


    【解决方案1】:

    难道不是下面这个……

    chart.setDimension(actuate.report.Chart.CHART_DIMENSION_2D_WITH_DEPTH);

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-17
      • 1970-01-01
      • 2018-01-07
      相关资源
      最近更新 更多