amcharts JS版使用教程以及案例.doc_第1页
amcharts JS版使用教程以及案例.doc_第2页
amcharts JS版使用教程以及案例.doc_第3页
amcharts JS版使用教程以及案例.doc_第4页
amcharts JS版使用教程以及案例.doc_第5页
已阅读5页,还剩9页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、单个学生成绩分析Action:Java代码 1. /*2. *功能:单个学生成绩分析3. *作者:smile4. *时间:2013-1-15下午2:23:215. *版本:1.06. */7. publicclassStudentScoreAnalyseActionextendsAbstractAction8. 9. /成绩单分数id10. privateinteduScoreListId;11. /成绩单id12. privateinteduExamInfoId;13. /成绩单科目14. privateStringsubjectName;15. /学生id16. privateStringuserid;17. /学生姓名18. privateStringuserName;19. /成绩单科目集合20. privateListEduExamList;21. /最高分22. privateStringmaxScore;23. /最低分24. privateStringminScore;25. /平均分26. privateStringaverageScore;27. /子女得分28. privateStringscore;29. /此次考试参加学生数30. privateintstudentNum;31. /1:总分分析2:单个科目分析32. privateintflag;33. /班级id34. privateStringclassId;35. 36. protectedStringgo()throwsException37. ScoreManageSrevicescoreManageService=(ScoreManageSrevice)this.getBean(scoreManageSrevice);38. EduExamList=scoreManageService.getSubjectByExamInfoId(eduExamInfoId);39. userName=.URLDecoder.decode(userName,UTF-8);40. classId=scoreManageService.getClassIdByEduExamInfoId(eduExamInfoId);41. 42. if(flag=1|flag=3)/总数分析43. /统计最高分44. maxScore=scoreManageService.getMaxScore(eduExamInfoId);45. /统计最低分46. minScore=scoreManageService.getMinScore(eduExamInfoId);47. /统计子女得分48. score=scoreManageService.getStudentScore(eduExamInfoId,userid);49. /统计平均得分50. averageScore=scoreManageService.getAverageScore(eduExamInfoId);51. /统计人数52. studentNum=scoreManageService.getStudentNum(eduExamInfoId);53. 54. if(flag=3)55. returnsuccess;56. 57. returninput;58. elseif(flag=2)/单个科目分析59. if(subjectName!=null&!.equals(subjectName)60. subjectName=.URLDecoder.decode(subjectName,UTF-8);61. /统计该科目最高分62. maxScore=scoreManageService.getSubjectMaxScore(eduExamInfoId,subjectName);63. /统计该科目最低分64. minScore=scoreManageService.getSubjectMinScore(eduExamInfoId,subjectName);65. /统计该用户userId该科目subjectName的得分66. score=scoreManageService.getSubjectStudentScore(eduExamInfoId,subjectName,userid);67. /统计该科目平均分68. averageScore=scoreManageService.getSubjectAverageScore(eduExamInfoId,subjectName);69. /统计参加考试人数70. studentNum=scoreManageService.getStudentNum(eduExamInfoId);71. 72. returnsuccess;73. 74. 75. returnnull;76. 77. 78. 省略get.set.79. 2、xml配置:Xml代码 1. 2. 3. /scoremanage/studentScoreAnalyse_index.ftl4. 5. 3、页面:Html代码 1. $(document).ready(function()2. 3. 4. if($flag=1)5. varchart;6. varchartData=7. 8. category:最高分,9. score:$maxScore,10. color:#FF0F0011. ,12. 13. category:最低分,14. score:$minScore,15. color:#88003B16. ,17. 18. category:平均分,19. score:$averageScore,20. color:#FF4D3421. ,22. 23. category:$userName分数,24. score:$score,25. color:#0081AC26. 27. ;28. 29. AmCharts.ready(function()30. 31. chart=newAmCharts.AmSerialChart();32. chart.dataProvider=chartData;33. chart.categoryField=category;34. 35. chart.depth3D=20;36. chart.angle=30;37. 38. chart.fontSize=13;39. chart.startDuration=1;40. chart.columnWidth=0.4;41. 42. 43. varcategoryAxis=chart.categoryAxis;44. 45. categoryAxis.labelRotation=0;46. categoryAxis.dashLength=5;47. categoryAxis.gridPosition=start;48. 49. categoryAxis.fontSize=13;50. 51. categoryAxis.offset=0;52. 53. categoryAxis.tickLength=8;54. 55. categoryAxis.gridAlpha=0;56. 57. 58. 59. varvalueAxis=newAmCharts.ValueAxis();60. valueAxis.dashLength=5;61. 62. valueAxis.axisThickness=1;63. valueAxis.gridAlpha=0;64. chart.addValueAxis(valueAxis);65. 66. 67. vargraph=newAmCharts.AmGraph();68. graph.valueField=score;69. graph.colorField=color;70. graph.balloonText=category:score;71. graph.type=column;72. graph.lineAlpha=0;73. graph.fillAlphas=1;74. 75. graph.lineThickness=1;76. chart.addGraph(graph);77. 78. 79. chart.write(chartdiv);80. );81. 82. );83. 84. 85. 86. 4:、柱形图:5、学生分数趋势分析:Java代码 1. /*2. *功能:单个学生多次成绩趋势分析3. *作者:smile4. *时间:2013-1-16下午5:42:205. *版本:1.06. */7. publicclassStudentScoreMemoryAnalyseActionextendsAbstractAction8. 9. privatestaticfinallongserialVersionUID=1L;10. 11. /学生id12. privateStringuserid;13. /学生姓名14. privateStringuserName;15. /学生姓名16. privateStringname;17. /存放学生总分数组18. privateListscore;19. 20. protectedStringgo()throwsException21. 22. ScoreManageSrevicescoreManageService=(ScoreManageSrevice)this.getBean(scoreManageSrevice);23. name=.URLDecoder.decode(userName,UTF-8);24. score=scoreManageService.getStudentScore(userid);25. returnsuccess;26. 27. 28. publicStringinput()29. returninput;30. 31. 32. 6、页面:Html代码 1. $(document).ready(function()2. 3. $.getJSON(4. ./scoremanage/studentScoreTrendAnalyse.action,5. userid:$userid,userName:$userName,number:Math.random(),6. function(json)7. 8. varchart;9. varchartData=;10. for(vari=0;ijson.score.length;i+)11. vardata=12. title:json.scorei.examTitle,13. score:json.scorei.score,14. average:json.scorei.averageScore15. ;16. chartData.push(data);17. 18. 19. chart=newAmCharts.AmSerialChart();20. chart.dataProvider=chartData;21. chart.categoryField=title;22. chart.startDuration=0.5;23. chart.fontSize=13;24. chart.fontFamily=微软雅黑;25. chart.balloon.color=#000000;26. 27. varcategoryAxis=chart.categoryAxis;28. categoryAxis.dashLength=1;29. categoryAxis.gridAlpha=0.15;30. categoryAxis.labelRotation=40;31. categoryAxis.axisColor=#DADADA;32. 33. varvalueAxis=newAmCharts.ValueAxis();34. valueAxis.axisColor=#DADADA;35. valueAxis.dashLength=1;36. valueAxis.logarithmic=false;37. chart.addValueAxis(valueAxis);38. 39. vargraph=newAmCharts.AmGraph();40. graph.title=+考试成绩;41. graph.valueField=score;42. graph.type=smoothedLine;43. graph.bullet=bubble;44. graph.bulletColor=#FFFFFF;45. graph.bulletBorderColor=#00BBCC;46. graph.bulletBorderThickness=1;47. graph.bulletSize=8;48. graph.balloonText=+总分为:score;49. graph.lineThickness=2;50. graph.lineColor=#00BBCC;51. chart.addGraph(graph);52. 53. vargraph=newAmCharts.AmGraph();54. graph.title=班级平均分成绩;55. graph.type=smoothedLine;56. graph.bullet=bubble;57. graph.bulletColor=#FFFFFF;58. graph.bulletBorderColor=#00BBCC;59. graph.bulletBorderThickness=1;60. graph.bulletSize=8;61. graph.balloonText=班级平均分为:average;62. graph.valueField=average;63. graph.lineThickness=2;64. graph.lineColor=#F45B00;65. chart.addGraph(graph);66. 67. varchartCursor=newAmCharts.ChartCursor();68. chartCursor.cursorPosition=middle;69. chartCursor.cursorColor=#D40600;70. chartCursor.bulletSize=8;71. chart.addChartCursor(chartCursor);72. 73. varlegend=newAmCharts.AmLegend();74. legend.markerType=circle;75. chart.addLegend(legend);76. 77. chart.write(chartdiv);78. 79. );80. );81. 82. 7、线形图:8、班级成绩分析:Java代码 1. /*2. *功能:班级成绩分析3. *作者:smile4. *时间:2013-1-17下午2:44:015. *版本:1.06. */7. publicclassClassScoreAnalyseActionextendsAbstractAction8. 9. privatestaticfinallongserialVersionUID=1L;10. 11. /成绩单id12. privateStringexamId;13. /成绩单科目集合14. privateListEduExamList;15. /科目名16. privateStringsubjectName;17. /优秀人数18. privateintexcellentCount;19. /良好人数20. privateintgoodCount;21. /及格人数22. privateintpassCount;23. /不及格人数24. privateintunpassCount;25. /科目总数26. privateStringmaxScore;27. 28. protectedStringgo()throwsException29. ScoreManageSrevicescoreManageService=(ScoreManageSrevice)this.getBean(scoreManageSrevice);30. EduExamList=scoreManageService.getSubjectByExamInfoId(Integer.valueOf(examId);31. 32. returnsuccess;33. 34. 35. publicStringinput()throwsException36. 37. ScoreManageSrevicescoreManageService=(ScoreManageSrevice)this.getBean(scoreManageSrevice);38. subjectName=.URLDecoder.decode(subjectName,UTF-8);39. 40. if(subjectName.equals(-1)/总成绩分析41. /统计总成绩的优秀人数42. excellentCount=scoreManageService.getSumCount(subjectName,examId,maxScore,0.8,1);43. /统计总成绩的良好人数44. goodCount=scoreManageService.getSumCount(subjectName,examId,maxScore,0.7,0.8);45. /统计总成绩的及格人数46. passCount=scoreManageService.getSumCount(subjectName,examId,maxScore,0.6,0.7);47. /统计总成绩的不及格人数48. unpassCount=scoreManageService.getSumCount(subjectName,examId,maxScore,0,0.6);49. else50. /统计该科目的优秀人数51. excellentCount=scoreManageService.getCount(subjectName,examId,maxScore,0.8,1);52. /统计该科目的良好人数53. goodCount=scoreManageService.getCount(subjectName,examId,maxScore,0.7,0.8);54. /统计该科目的及格人数55. passCount=scoreManageService.getCount(subjectName,examId,maxScore,0.6,0.7);56. /统计该科目的不及格人数57. unpassCount=scoreManageService.getCount(subjectName,examId,maxScore,0,0.6);58. 59. returninput;60. 61. 62. 9、页面:Js代码 1. /班级成绩分析科目分析2. functionclassScoreInfoAnalyse()3. 4. /取出隐藏域中的成绩单Id5. varexamId=$(#examId).val();6. /判断输入框总分是否为正整数7. varregx=/(1-9d*)$/;8. if(!regx.test($(#scoreSum).val()9. alert(输入的总分不是正整数!);10. returnfalse;11. 12. /总分13. varmaxScore=$(#scoreSum).val();14. /当前选中需要分析的科目名15. varsubjectName=$(#myCjfx_tit.currenta).attr(value);16. subjectName=encodeURI(subjectName);17. 18. $.getJSON(19. ./scoremanage/classScoreAnalyse!input.action,20. examId:examId,subjectName:subjectName,maxScore:maxScore,number:Math.random(),21. function(json)22. varchart;23. varchartData=24. 25. category:优秀,26. count:json.excellentCount,27. color:#FF4D1C28. ,29. category:良好,30. count:json.goodCount,31. color:#20B3FF32. ,33. category:及格,34. count:json.passCount

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论