Development of composite charts in owc (bar chart + line chart)

Source: Internet
Author: User
Code

  // Create a chartspace object to place charts
Chartspace =   New Chartspaceclass ();

//Show legend
Chartspace. haschartspacelegend= True;

//Add a chart to the chartspace object. The add method returns the chart object.
Chchart=Chartspace. charts. Add (0);

// given title
chchart. hastitle = true ;
chchart. title. caption = " material not required " ;

// given X,
chchart. axes [ 0 ]. hastitle = true ;
chchart. axes [ 0 ]. title. caption = " X: date " ;

Chchart. Axes [1]. Hastitle= True;
Chchart. Axes [1]. Title. Caption= "Y: No.";

/*Column stacked chart*/

// set the chart type
chchart. seriescollection. add ( 0 );
chchart. seriescollection [ 0 ]. type = chartcharttypeenum. chcharttypecolumnstacked;

// series PG1
// name of a Series

chchart. seriescollection [ 0 ]. setdata (chartdimensionsenum. chdimseriesnames,
( int ) chartspecialperformancesenum. chdataliteral, " PG1 " );

// given classification
chchart. seriescollection [ 0 ]. setdata (chartdimensionsenum. chdimcategories,
( int ) chartspecialdatasourcesenum. chdataliteral, " material a \ t material B \ t Material C \ t material d \ t " );

//Value of a given series
Chchart. seriescollection [0]. Setdata
(Chartdimensionsenum. chdimvalues,
(Int) Chartspecialdatasourcesenum. chdataliteral,"1 \ t0 \ T2 \ T2 \ t");

// Series pd1
// Name of the specified Series
Chchart. seriescollection. Add ( 1 );
Chchart. seriescollection [ 1 ]. Setdata (chartdimensionsenum. chdimseriesnames,
+ ( Int ) Chartspecialdatasourcesenum. chdataliteral, " Pd1 " );

// given classification
chchart. seriescollection [ 1 ]. setdata (chartdimensionsenum. chdimcategories,
+ ( int ) chartspecialperformancesenum. chdataliteral, " material a \ t material B \ t Material C \ t material d \ t " );

//Value of a given series
Chchart. seriescollection [1]. Setdata
(Chartdimensionsenum. chdimvalues,
(Int) Chartspecialdatasourcesenum. chdataliteral,"0 \ T3 \ T2 \ T3 \ t");

// Series PB1
// Name of the specified Series
Chchart. seriescollection. Add ( 2 );
Chchart. seriescollection [ 0 ]. Setdata (chartdimensionsenum. chdimseriesnames,
+ ( Int ) Chartspecialdatasourcesenum. chdataliteral, " PB1 " );

// given classification
chchart. seriescollection [ 2 ]. setdata (chartdimensionsenum. chdimcategories,
+ ( int ) chartspecialperformancesenum. chdataliteral, " material a \ t material B \ t Material C \ t material d \ t " );

// value of a given series
chchart. seriescollection [ 2 ]. setdata
(chartdimensionsenum. chdimvalues,
( int ) chartspecialperformancesenum. chdataliteral, " 1 \ t1 \ t1 \ T2 \ t " );

/* line chart */
// Add another series
chseries = chchart. seriescollection. add ( 0 );

//Specify chart type
Chseries. Type=Chartcharttypeenum. chcharttypelinemarkers;
Chseries. ungroup (True);

Chaxis=Chchart. Axes. Add (chseries. get_scalings (chartdimensionsenum. chdimvalues ));
Chaxis. Position=Chartaxispositionenum. chaxispositionright;

Chaxis. hasminorgridlines =   False ;
Chaxis. hastitle =   True ;
Chaxis. Title. Caption =   " Quantity Used " ;
// Name of the specified Series
Chseries. setdata (chartdimensionsenum. chdimseriesnames,
+ ( Int ) Chartspecialdatasourcesenum. chdataliteral, " Quantity Used " );

//Value of a given series
Chseries. setdata
(Chartdimensionsenum. chdimvalues,
(Int) Chartspecialdatasourcesenum. chdataliteral,"200 \ t120 \ T90 \ t150 \ t");

// Output as a GIF file.
String Strabsolutepath = (Server. mappath ( " . " )) +   " \ Temp \ test.gif " ;
Chartspace. exportpicture (strabsolutepath, " GIF " , 600 , 350 );

// Create the relative path of the GIF file.
string strrelativepath = " . /temp/test.gif " ;

//Show Image
Image1.imageurl=Strrelativepath. tostring ();

 

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.