Use youhua table cell to generate a columnar chart

Source: Internet
Author: User

Function fn_doresult (result)
{
If (result = "")
{
Alert ("operation failed ");
Return;
}
VaR xmldom = new activexobject ("Microsoft. xmldom ");
Xmldom. loadxml (result );
VaR rownum = 0;
VaR colnum = 0;
Rownum = xmldom.doc umentelement. childnodes. length;
// If you find the information
If (rownum> 0)
{
Document. form1.cellweb1. workbookreadonly = false; // cancel read-only for report writing
VaR firstrow = xmldom.doc umentelement. childnodes [0]; // The first line

//
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 (, 0); // create a Statistical Chart // create a chart using data in the specified area

Document. form1.cellweb1. setcharttype (0, 0, 0); // you can specify the type column chart of the chart.

Document. form1.cellweb1. setyaxistittle ("count", 0, 0); // y axis title

Document. form1.cellweb1. movechartonarea (,); // move the chart to the specified position on the specified Table Page
Document. form1.cellweb1. setxlabelarea );
Document. form1.cellweb1. showlegend (false, 0, 0 );
Document. form1.cellweb1. showcharttittle (false,); // whether to display the legend showcharttittle
Document. form1.cellweb1. showyaxistittle (true, 0, 0 );
Document. form1.cellweb1. showxaxistittle (false, 0, 0 );
Document. form1.cellweb1. allowdragchart = false; // do not drag or drop a chart. Modify the chart.
Document. form1.cellweb1. showdatasign (true, 0, 0); // display the value

Document. form1.cellweb1. setchartfont ("", 14, 0, 0 );
// Set unit information
VaR strvalue = Document. All. unitctl1_txtunittext.value;
Document. form1.cellweb1. setcellstring (2, 23, 0, strvalue );
}
Else
{
Alert ("operation failed ");
}

// Report display after statistics are completed
Tab_pagedata.style.display = "Block ";
Tab_waitmsg.style.display = "NONE ";
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.