ITPub博客

首页 > 应用开发 > Java > 用友华表Cell产生柱状图表

用友华表Cell产生柱状图表

Java 作者:破棉袄 时间:2014-07-16 13:46:16 0 删除 编辑

用友华表Cell产生柱状图表

function fn_DoResult(result)
{
    if(result=="")
    {
        alert("操作失败");
        return;
    }
    var xmlDom = new ActiveXObject("Microsoft.XMLDOM");
        xmlDom.loadXML(result);
    var rowNum = 0 ;
    var colNum = 0 ;
    rowNum = xmlDom.documentElement.childNodes.length;
    //如果查出资料
    if(rowNum>0)
    {   
        document.form1.Cellweb1.WorkbookReadonly = false;//取消只读 进行报表写入
        var firstRow = xmlDom.documentElement.childNodes[0];//第一行

        //
        document.form1.Cellweb1.SetCellDouble(3,26,0,firstRow.childNodes[0].text);
        document.form1.Cellweb1.SetCellDouble(4,26,0,firstRow.childNodes[1].text);
        document.form1.Cellweb1.SetCellDouble(5,26,0,firstRow.childNodes[2].text);
        document.form1.Cellweb1.SetCellDouble(6,26,0,firstRow.childNodes[3].text);
        document.form1.Cellweb1.SetCellDouble(7,26,0,firstRow.childNodes[4].text);
        document.form1.Cellweb1.SetCellDouble(8,26,0,firstRow.childNodes[5].text); 
        //
        document.form1.Cellweb1.CreateChart(3,26,8,26,0);//建立统计图///通过指定区域的数据建立图表

        document.form1.Cellweb1.SetChartType(0,0,0);//设定图表的类型 柱状图
        document.form1.Cellweb1.SetYAxisTittle("人数", 0, 0);//y坐标轴标题

        document.form1.Cellweb1.MoveChartOnArea(3,4,7,21,0,0);//将图表移动到指定表页的指定位置上
        document.form1.Cellweb1.SetXLabelArea(3,25,8,25,0,0);
        document.form1.Cellweb1.ShowLegend(false,0,0);
        document.form1.Cellweb1.ShowChartTittle(false,0,0);//是否显示图例 ShowChartTittle
        document.form1.Cellweb1.ShowYAxisTittle(true,0,0);
        document.form1.Cellweb1.ShowXAxisTittle(false,0,0);
        document.form1.Cellweb1.AllowDragChart  = false;//禁止用户拖拽,修改图表
        document.form1.Cellweb1.ShowDataSign(true, 0, 0);//显示数值

        document.form1.Cellweb1.SetChartFont("宋体", 14, 0, 0);
        //设置单位信息
        var strvalue=document.all.UnitCtl1_txtUnitText.value;
        document.form1.Cellweb1.SetCellString(2,23,0,strvalue);
    }   
    else
    {
        alert("操作失败");
    }
    //统计完毕 报表显示
    tab_PageData.style.display="block";
    tab_WaitMsg.style.display="none";
}

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29754888/viewspace-1220299/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-07-16

  • 博文量
    180
  • 访问量
    1158151