Gantt Chart JPEG format
Step 3: Configure structs. xmlBecause we need to integrate JFreechart and structs, We need to configure action in structs. xml.
<! DOCTYPE struts PUBLIC "-// Apache Software Foundation // DTD Struts Configuration 2.1 // EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<Struts>
<! -- Allow static methods -->
<Constant name = "struts. ognl. allowStaticMethodAccess" value = "true"> </constant>
<! -- Chinese -->
<Constant name = "struts. i18n. encoding" value = "gbk"/>
<Package name = "QQ" extends = "jfreechart-default">
<Action name = "jfreechart" class = "com. softeem. action. JfreeCharAction"> <! -- Configure the action used on the page -->
<Result name = "success" type = "chart">
<Param name = "width"> 600 </param>
& Lt; param name = "height" & gt; 400 & lt;/param & gt;
</Result>
</Action>
<Action name = "jfreechart1" class = "com. softeem. action. QQ_Count_Action">
<Result name = "success" type = "chart">
<Param name = "width"> 600 </param>
& Lt; param name = "height" & gt; 400 & lt;/param & gt;
</Result>
</Action>
<Action name = "jfreechart2" class = "com. softeem. action. JfreeCharAction">
<Result name = "success" type = "chart">
<Param name = "width"> 600 </param>
& Lt; param name = "height" & gt; 400 & lt;/param & gt;
</Result>
</Action>
<Action name = "jfreechart3" class = "com. softeem. action. JfreeCharAction">
<Result name = "success" type = "chart">
<Param name = "width"> 600 </param>
& Lt; param name = "height" & gt; 400 & lt;/param & gt;
</Result>
</Action>
<Action name = "jfreechart4" class = "com. softeem. action. JfreeCharAction">
<Result name = "success" type = "chart">
<Param name = "width"> 600 </param>
& Lt; param name = "height" & gt; 400 & lt;/param & gt;
</Result>
</Action>
</Package>
</Struts>
Chart. setBackgroundPaint (ChartColor. WHITE );
// Set the title Color
Chart. getTitle (). setPaint (ChartColor. blue );
// Obtain the chart object
CategoryPlot p = chart. getCategoryPlot ();
// Set the background color of the image. This is the background color of the second layer, that is, the color of the border around the image.
P. setBackgroundPaint (ChartColor. WHITE );
// Set the table line color
P. setRangeGridlinePaint (ChartColor. red );