高分求教如何在web页面上(不用applet)画饼图??? 不用applet用什么啊?光用html标签是做不到的。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 如果只用ie,可以使用vml(矢量标记语言)如果是兼容其他浏览器可用svg(w3c标准)但需装个小插件(adobe有)一个vml例子<html><body><xml:namespace prefix="v"/><style>v\:* {behavior=url(#default#VML)}</style><v:group style="width:553;height:427" coordsize="553,427" coordorigin="0,0"><v:rect style="position:absolute;left:0;top:0;width:553;height:427" fillcolor="#C0C0C0" stroked="f"/><v:rect style="position:absolute;left:495;top:47;width:40;height:86" fillcolor="#0" stroked="f"/><v:rect style="position:absolute;left:491;top:43;width:40;height:86" fillcolor="#FFFFFF" strokecolor="#0"/><v:textbox style="position:absolute; left:509; top:45; text-color="#0" text-align:left"><font color="#0" face="Arial" size="1">118</font></v:textbox><v:rect style="position:absolute;left:497;top:46;width:7;height:10" fillcolor="#FF0000" strokecolor="#0"/><v:textbox style="position:absolute; left:509; top:59; text-color="#0" text-align:left"><font color="#0" face="Arial" size="1">208</font></v:textbox><v:rect style="position:absolute;left:497;top:60;width:7;height:10" fillcolor="#008000" strokecolor="#0"/><v:textbox style="position:absolute; left:509; top:73; text-color="#0" text-align:left"><font color="#0" face="Arial" size="1">133</font></v:textbox><v:rect style="position:absolute;left:497;top:74;width:7;height:10" fillcolor="#FFFF00" strokecolor="#0"/><v:textbox style="position:absolute; left:515; top:87; text-color="#0" text-align:left"><font color="#0" face="Arial" size="1">76</font></v:textbox><v:rect style="position:absolute;left:497;top:88;width:7;height:10" fillcolor="#0000FF" strokecolor="#0"/><v:textbox style="position:absolute; left:509; top:101; text-color="#0" text-align:left"><font color="#0" face="Arial" size="1">118</font></v:textbox><v:rect style="position:absolute;left:497;top:102;width:7;height:10" fillcolor="#FFFFFF" strokecolor="#0"/><v:rect style="position:absolute;left:497;top:102;width:7;height:10" strokecolor="#0"/><v:textbox style="position:absolute; left:515; top:115; text-color="#0" text-align:left"><font color="#0" face="Arial" size="1">72</font></v:textbox><v:rect style="position:absolute;left:497;top:116;width:7;height:10" fillcolor="#808080" strokecolor="#0"/><v:textbox style="position:absolute; left:231; top:19; text-color="#0000FF" text-align:left"><font color="#0000FF" face="Arial" size="1">Chart1</font></v:textbox><v:shape style="position:absolute;width:553;height:427" fillcolor="#006000" strokecolor="#0"> <v:path v="m 232,198 l 69,169 69,179 232,208 x e"/></v:shape><v:shape style="position:absolute;width:553;height:427" fillcolor="#006000" strokecolor="#0"> <v:path v="m 232,198 l 322,118 322,128 232,208 x e"/></v:shape><v:shape style="position:absolute;width:553;height:427" fillcolor="#008000" strokecolor="#0"> <v:path v="m 232,198 l 322,118 296,112 270,107 242,104 214,105 186,108 160,113 135,121 113,131 94,142 79,155 69,169 x e"/></v:shape><v:shape style="position:absolute;width:553;height:427" fillcolor="#DF0000" strokecolor="#0"> <v:path v="m 246,219 l 418,219 418,229 246,229 x e"/></v:shape><v:shape style="position:absolute;width:553;height:427" fillcolor="#FF0000" strokecolor="#0"> <v:path v="m 246,219 l 418,219 416,206 411,192 402,179 389,167 374,157 356,148 336,139 x e"/></v:shape><v:shape style="position:absolute;width:553;height:427" fillcolor="#DFDF00" strokecolor="#0"> <v:path v="m 246,219 l 131,288 131,298 246,229 x e"/></v:shape><v:shape style="position:absolute;width:553;height:427" fillcolor="#FFFF00" strokecolor="#0"> <v:path v="m 246,219 l 83,190 77,203 74,216 75,230 80,243 88,256 99,268 114,278 131,288 x e"/></v:shape><v:shape style="position:absolute;width:553;height:427" fillcolor="#DFDF00" strokecolor="#0"> <v:path v="m 74,216 l 75,230 80,243 88,256 99,268 114,278 131,288 131,298 114,288 99,278 88,266 80,253 75,240 74,226 x e"/></v:shape><v:shape style="position:absolute;width:553;height:427" fillcolor="#606060" strokecolor="#0"> <v:path v="m 246,219 l 386,273 386,283 246,229 x e"/></v:shape><v:shape style="position:absolute;width:553;height:427" fillcolor="#808080" strokecolor="#0"> <v:path v="m 246,219 l 386,273 397,264 406,253 413,242 417,230 418,219 x e"/></v:shape><v:shape style="position:absolute;width:553;height:427" fillcolor="#606060" strokecolor="#0"> <v:path v="m 386,273 l 397,264 406,253 413,242 417,230 418,219 418,229 417,240 413,252 406,263 397,273 386,283 x e"/></v:shape><v:shape style="position:absolute;width:553;height:427" fillcolor="#FFFFFF" strokecolor="#0"> <v:path v="m 246,219 l 233,312 258,312 283,310 307,306 330,300 351,293 369,284 386,273 x e"/></v:shape><v:shape style="position:absolute;width:553;height:427" fillcolor="#DFDFDF" strokecolor="#0"> <v:path v="m 233,312 l 258,312 283,310 307,306 330,300 351,293 369,284 386,273 386,283 369,294 351,303 330,310 307,316 283,320 258,322 233,322 x e"/></v:shape> <!--下半部分--><v:shape style="position:absolute;width:553;height:427" fillcolor="#0000DF" strokecolor="#0"> <v:path v="m 246,219 l 233,312 233,322 246,229 x e"/></v:shape><v:shape style="position:absolute;width:553;height:427" fillcolor="#0000FF" strokecolor="#0"> <v:path v="m 246,219 l 131,288 148,296 168,302 189,307 211,310 233,312 x e"/></v:shape><v:shape style="position:absolute;width:553;height:427" fillcolor="#0000DF" strokecolor="#0"> <v:path v="m 131,288 l 148,296 168,302 189,307 211,310 233,312 233,322 211,320 189,317 168,312 148,306 131,298 x e"/></v:shape><v:line from="396,173" to="413,167" strokeweight="1" strokecolor="#FFFFFF"/><v:rect style="position:absolute;left:415;top:153;width:30;height:16" fillcolor="#808080" stroked="f"/><v:rect style="position:absolute;left:413;top:151;width:30;height:16" fillcolor="#FFFFE1" strokecolor="#0"/><v:textbox style="position:absolute; left:421; top:179; text-color="#0" text-align:left"><font color="#0" face="Arial" size="1">118</font></v:textbox><v:line from="172,110" to="165,97" strokeweight="1" strokecolor="#FFFFFF"/><v:rect style="position:absolute;left:137;top:83;width:30;height:16" fillcolor="#808080" stroked="f"/><v:rect style="position:absolute;left:135;top:81;width:30;height:16" fillcolor="#FFFFE1" strokecolor="#0"/><v:textbox style="position:absolute; left:143; top:130; text-color="#0" text-align:left"><font color="#0" face="Arial" size="1">208</font></v:textbox><v:line from="80,243" to="60,247" strokeweight="1" strokecolor="#FFFFFF"/><v:rect style="position:absolute;left:32;top:249;width:30;height:16" fillcolor="#808080" stroked="f"/><v:rect style="position:absolute;left:30;top:247;width:30;height:16" fillcolor="#FFFFE1" strokecolor="#0"/><v:textbox style="position:absolute; left:38; top:247; text-color="#0" text-align:left"><font color="#0" face="Arial" size="1">133</font></v:textbox><v:line from="178,305" to="170,318" strokeweight="1" strokecolor="#FFFFFF"/><v:rect style="position:absolute;left:148;top:320;width:24;height:16" fillcolor="#808080" stroked="f"/><v:rect style="position:absolute;left:146;top:318;width:24;height:16" fillcolor="#FFFFE1" strokecolor="#0"/><v:textbox style="position:absolute; left:154; top:297; text-color="#0" text-align:left"><font color="#0" face="Arial" size="1">76</font></v:textbox><v:line from="319,304" to="327,317" strokeweight="1" strokecolor="#FFFFFF"/><v:rect style="position:absolute;left:329;top:319;width:30;height:16" fillcolor="#808080" stroked="f"/><v:rect style="position:absolute;left:327;top:317;width:30;height:16" fillcolor="#FFFFE1" strokecolor="#0"/><v:textbox style="position:absolute; left:335; top:296; text-color="#0" text-align:left"><font color="#0" face="Arial" size="1">118</font></v:textbox><v:line from="410,248" to="429,252" strokeweight="1" strokecolor="#FFFFFF"/><v:rect style="position:absolute;left:431;top:254;width:24;height:16" fillcolor="#808080" stroked="f"/><v:rect style="position:absolute;left:429;top:252;width:24;height:16" fillcolor="#FFFFE1" strokecolor="#0"/><v:textbox style="position:absolute; left:437; top:250; text-color="#0" text-align:left"><font color="#0" face="Arial" size="1">72</font></v:textbox><v:shape style="position:absolute;width:553;height:427" fillcolor="#FFFFFF" strokecolor="#0"> <v:path v="m 14,205 l 20,205 20,209 14,209 x e"/></v:shape><v:shape style="position:absolute;width:553;height:427" fillcolor="#FFFFFF" strokecolor="#0"> <v:path v="m 106,91 l 112,91 112,95 106,95 x e"/></v:shape><v:shape style="position:absolute;width:553;height:427" fillcolor="#FFFFFF" strokecolor="#0"> <v:path v="m 197,186 l 203,186 203,190 197,190 x e"/></v:shape><v:shape style="position:absolute;width:553;height:427" fillcolor="#FFFFFF" strokecolor="#0"> <v:path v="m 289,257 l 295,257 295,261 289,261 x e"/></v:shape><v:shape style="position:absolute;width:553;height:427" fillcolor="#FFFFFF" strokecolor="#0"> <v:path v="m 380,205 l 386,205 386,209 380,209 x e"/></v:shape><v:shape style="position:absolute;width:553;height:427" fillcolor="#FFFFFF" strokecolor="#0"> <v:path v="m 472,263 l 478,263 478,267 472,267 x e"/></v:shape></v:group></body></html> 如果你打算不用JAVA做,当然可以,用OFFICE里自带的插件就可以了 真逗,直接写一个类来画不就行了吗!然后用jsp来调用这个类生成图就可以了,什么饼图,柱图,曲线图一网打尽。主要用到的类有FileOutputStream、BufferedImage、Graphics2D、JPEGImageEncoder等你只要好好看看上面这几个类的用法就能写了。 页面如何显示登录错误次数 急急急 新手求助,如果获取上一级标签. 类方法中调用实例方法? 请教关于eclipse的问题 大虾,帮帮我。问个JAVA应用程序占用内存的问题。 把什么什么放在内存里。。。 什么是扇入与扇出呀? poi建立excel文档,如何建立中文名的sheet? 不用上班也有钱花了,真是乐哉乐哉 操作blob到ORACLE,当数量大时,非常慢,请问如何解决呢 我该怎么办 请问有谁知道PrinterResolution怎么和打印机对象连在一起呀,
如果是兼容其他浏览器可用svg(w3c标准)但需装个小插件(adobe有)一个vml例子<html>
<body>
<xml:namespace prefix="v"/>
<style>v\:* {behavior=url(#default#VML)}</style>
<v:group style="width:553;height:427" coordsize="553,427" coordorigin="0,0">
<v:rect style="position:absolute;left:0;top:0;width:553;height:427" fillcolor="#C0C0C0" stroked="f"/>
<v:rect style="position:absolute;left:495;top:47;width:40;height:86" fillcolor="#0" stroked="f"/>
<v:rect style="position:absolute;left:491;top:43;width:40;height:86" fillcolor="#FFFFFF" strokecolor="#0"/>
<v:textbox style="position:absolute; left:509; top:45; text-color="#0" text-align:left">
<font color="#0" face="Arial" size="1">
118
</font>
</v:textbox>
<v:rect style="position:absolute;left:497;top:46;width:7;height:10" fillcolor="#FF0000" strokecolor="#0"/>
<v:textbox style="position:absolute; left:509; top:59; text-color="#0" text-align:left">
<font color="#0" face="Arial" size="1">
208
</font>
</v:textbox>
<v:rect style="position:absolute;left:497;top:60;width:7;height:10" fillcolor="#008000" strokecolor="#0"/>
<v:textbox style="position:absolute; left:509; top:73; text-color="#0" text-align:left">
<font color="#0" face="Arial" size="1">
133
</font>
</v:textbox>
<v:rect style="position:absolute;left:497;top:74;width:7;height:10" fillcolor="#FFFF00" strokecolor="#0"/>
<v:textbox style="position:absolute; left:515; top:87; text-color="#0" text-align:left">
<font color="#0" face="Arial" size="1">
76
</font>
</v:textbox>
<v:rect style="position:absolute;left:497;top:88;width:7;height:10" fillcolor="#0000FF" strokecolor="#0"/>
<v:textbox style="position:absolute; left:509; top:101; text-color="#0" text-align:left">
<font color="#0" face="Arial" size="1">
118
</font>
</v:textbox>
<v:rect style="position:absolute;left:497;top:102;width:7;height:10" fillcolor="#FFFFFF" strokecolor="#0"/>
<v:rect style="position:absolute;left:497;top:102;width:7;height:10" strokecolor="#0"/>
<v:textbox style="position:absolute; left:515; top:115; text-color="#0" text-align:left">
<font color="#0" face="Arial" size="1">
72
</font>
</v:textbox>
<v:rect style="position:absolute;left:497;top:116;width:7;height:10" fillcolor="#808080" strokecolor="#0"/>
<v:textbox style="position:absolute; left:231; top:19; text-color="#0000FF" text-align:left">
<font color="#0000FF" face="Arial" size="1">
Chart1
</font>
</v:textbox>
<v:shape style="position:absolute;width:553;height:427" fillcolor="#006000" strokecolor="#0">
<v:path v="m 232,198 l 69,169 69,179 232,208 x e"/>
</v:shape>
<v:shape style="position:absolute;width:553;height:427" fillcolor="#006000" strokecolor="#0">
<v:path v="m 232,198 l 322,118 322,128 232,208 x e"/>
</v:shape>
<v:shape style="position:absolute;width:553;height:427" fillcolor="#008000" strokecolor="#0">
<v:path v="m 232,198 l 322,118 296,112 270,107 242,104 214,105 186,108 160,113 135,121 113,131 94,142 79,155 69,169 x e"/>
</v:shape>
<v:shape style="position:absolute;width:553;height:427" fillcolor="#DF0000" strokecolor="#0">
<v:path v="m 246,219 l 418,219 418,229 246,229 x e"/>
</v:shape>
<v:shape style="position:absolute;width:553;height:427" fillcolor="#FF0000" strokecolor="#0">
<v:path v="m 246,219 l 418,219 416,206 411,192 402,179 389,167 374,157 356,148 336,139 x e"/>
</v:shape>
<v:shape style="position:absolute;width:553;height:427" fillcolor="#DFDF00" strokecolor="#0">
<v:path v="m 246,219 l 131,288 131,298 246,229 x e"/>
</v:shape>
<v:shape style="position:absolute;width:553;height:427" fillcolor="#FFFF00" strokecolor="#0">
<v:path v="m 246,219 l 83,190 77,203 74,216 75,230 80,243 88,256 99,268 114,278 131,288 x e"/>
</v:shape>
<v:shape style="position:absolute;width:553;height:427" fillcolor="#DFDF00" strokecolor="#0">
<v:path v="m 74,216 l 75,230 80,243 88,256 99,268 114,278 131,288 131,298 114,288 99,278 88,266 80,253 75,240 74,226 x e"/>
</v:shape>
<v:shape style="position:absolute;width:553;height:427" fillcolor="#606060" strokecolor="#0">
<v:path v="m 246,219 l 386,273 386,283 246,229 x e"/>
</v:shape>
<v:shape style="position:absolute;width:553;height:427" fillcolor="#808080" strokecolor="#0">
<v:path v="m 246,219 l 386,273 397,264 406,253 413,242 417,230 418,219 x e"/>
</v:shape>
<v:shape style="position:absolute;width:553;height:427" fillcolor="#606060" strokecolor="#0">
<v:path v="m 386,273 l 397,264 406,253 413,242 417,230 418,219 418,229 417,240 413,252 406,263 397,273 386,283 x e"/>
</v:shape>
<v:shape style="position:absolute;width:553;height:427" fillcolor="#FFFFFF" strokecolor="#0">
<v:path v="m 246,219 l 233,312 258,312 283,310 307,306 330,300 351,293 369,284 386,273 x e"/>
</v:shape>
<v:shape style="position:absolute;width:553;height:427" fillcolor="#DFDFDF" strokecolor="#0">
<v:path v="m 233,312 l 258,312 283,310 307,306 330,300 351,293 369,284 386,273 386,283 369,294 351,303 330,310 307,316 283,320 258,322 233,322 x e"/>
</v:shape>
<v:shape style="position:absolute;width:553;height:427" fillcolor="#0000DF" strokecolor="#0">
<v:path v="m 246,219 l 233,312 233,322 246,229 x e"/>
</v:shape>
<v:shape style="position:absolute;width:553;height:427" fillcolor="#0000FF" strokecolor="#0">
<v:path v="m 246,219 l 131,288 148,296 168,302 189,307 211,310 233,312 x e"/>
</v:shape>
<v:shape style="position:absolute;width:553;height:427" fillcolor="#0000DF" strokecolor="#0">
<v:path v="m 131,288 l 148,296 168,302 189,307 211,310 233,312 233,322 211,320 189,317 168,312 148,306 131,298 x e"/>
</v:shape>
<v:line from="396,173" to="413,167" strokeweight="1" strokecolor="#FFFFFF"/>
<v:rect style="position:absolute;left:415;top:153;width:30;height:16" fillcolor="#808080" stroked="f"/>
<v:rect style="position:absolute;left:413;top:151;width:30;height:16" fillcolor="#FFFFE1" strokecolor="#0"/>
<v:textbox style="position:absolute; left:421; top:179; text-color="#0" text-align:left">
<font color="#0" face="Arial" size="1">
118
</font>
</v:textbox>
<v:line from="172,110" to="165,97" strokeweight="1" strokecolor="#FFFFFF"/>
<v:rect style="position:absolute;left:137;top:83;width:30;height:16" fillcolor="#808080" stroked="f"/>
<v:rect style="position:absolute;left:135;top:81;width:30;height:16" fillcolor="#FFFFE1" strokecolor="#0"/>
<v:textbox style="position:absolute; left:143; top:130; text-color="#0" text-align:left">
<font color="#0" face="Arial" size="1">
208
</font>
</v:textbox>
<v:line from="80,243" to="60,247" strokeweight="1" strokecolor="#FFFFFF"/>
<v:rect style="position:absolute;left:32;top:249;width:30;height:16" fillcolor="#808080" stroked="f"/>
<v:rect style="position:absolute;left:30;top:247;width:30;height:16" fillcolor="#FFFFE1" strokecolor="#0"/>
<v:textbox style="position:absolute; left:38; top:247; text-color="#0" text-align:left">
<font color="#0" face="Arial" size="1">
133
</font>
</v:textbox>
<v:line from="178,305" to="170,318" strokeweight="1" strokecolor="#FFFFFF"/>
<v:rect style="position:absolute;left:148;top:320;width:24;height:16" fillcolor="#808080" stroked="f"/>
<v:rect style="position:absolute;left:146;top:318;width:24;height:16" fillcolor="#FFFFE1" strokecolor="#0"/>
<v:textbox style="position:absolute; left:154; top:297; text-color="#0" text-align:left">
<font color="#0" face="Arial" size="1">
76
</font>
</v:textbox>
<v:line from="319,304" to="327,317" strokeweight="1" strokecolor="#FFFFFF"/>
<v:rect style="position:absolute;left:329;top:319;width:30;height:16" fillcolor="#808080" stroked="f"/>
<v:rect style="position:absolute;left:327;top:317;width:30;height:16" fillcolor="#FFFFE1" strokecolor="#0"/>
<v:textbox style="position:absolute; left:335; top:296; text-color="#0" text-align:left">
<font color="#0" face="Arial" size="1">
118
</font>
</v:textbox>
<v:line from="410,248" to="429,252" strokeweight="1" strokecolor="#FFFFFF"/>
<v:rect style="position:absolute;left:431;top:254;width:24;height:16" fillcolor="#808080" stroked="f"/>
<v:rect style="position:absolute;left:429;top:252;width:24;height:16" fillcolor="#FFFFE1" strokecolor="#0"/>
<v:textbox style="position:absolute; left:437; top:250; text-color="#0" text-align:left">
<font color="#0" face="Arial" size="1">
72
</font>
</v:textbox>
<v:shape style="position:absolute;width:553;height:427" fillcolor="#FFFFFF" strokecolor="#0">
<v:path v="m 14,205 l 20,205 20,209 14,209 x e"/>
</v:shape>
<v:shape style="position:absolute;width:553;height:427" fillcolor="#FFFFFF" strokecolor="#0">
<v:path v="m 106,91 l 112,91 112,95 106,95 x e"/>
</v:shape>
<v:shape style="position:absolute;width:553;height:427" fillcolor="#FFFFFF" strokecolor="#0">
<v:path v="m 197,186 l 203,186 203,190 197,190 x e"/>
</v:shape>
<v:shape style="position:absolute;width:553;height:427" fillcolor="#FFFFFF" strokecolor="#0">
<v:path v="m 289,257 l 295,257 295,261 289,261 x e"/>
</v:shape>
<v:shape style="position:absolute;width:553;height:427" fillcolor="#FFFFFF" strokecolor="#0">
<v:path v="m 380,205 l 386,205 386,209 380,209 x e"/>
</v:shape>
<v:shape style="position:absolute;width:553;height:427" fillcolor="#FFFFFF" strokecolor="#0">
<v:path v="m 472,263 l 478,263 478,267 472,267 x e"/>
</v:shape>
</v:group>
</body>
</html>
然后用jsp来调用这个类生成图就可以了,什么饼图,柱图,曲线图一网打尽。
主要用到的类有
FileOutputStream、BufferedImage、Graphics2D、JPEGImageEncoder等
你只要好好看看上面这几个类的用法就能写了。