开发者博客:http://www.developsearch.com
/**
* 拼装统计报表 饼图 json yahooYui
*
* @param json
* @param res
* @throws UnsupportedEncodingException
* @throws Exception
*/
public void fetchContentTypeStatChartData(JSONObject json,GetContentTypeStateResponse res) throws UnsupportedEncodingException
{
StringBuffer JSON_STR = new StringBuffer();
if( null != res.getContentTypes() && res.getContentTypes().size() > 0 )
{
JSON_STR.append("[");
ContentTypeState content = res.getContentTypes().get(0);
JSON_STR.append("{ response: '电子书刊', count: "+content.getBooks().substring(0,content.getBooks().length()-1)+" },");
JSON_STR.append("{ response: '媒体教材', count: "+content.getMedia().substring(0,content.getMedia().length()-1)+" },");
JSON_STR.append("{ response: '案例', count: "+content.getCaze().substring(0,content.getCaze().length()-1)+" },");
JSON_STR.append("{ response: '量规集', count: "+content.getGauge().substring(0,content.getGauge().length()-1)+" },");
JSON_STR.append("{ response: '教学工具和模板', count: "+content.getTemplate().substring(0,content.getTemplate().length()-1)+" },");
JSON_STR.append("{ response: '文献资料', count: "+content.getDocument().substring(0,content.getDocument().length()-1)+" },");
JSON_STR.append("{ response: '索引目录', count: "+content.getIndexCata().substring(0,content.getIndexCata().length()-1)+" },");
JSON_STR.append("{ response: '课程', count: "+content.getCourse().substring(0,content.getCourse().length()-1)+" }");
JSON_STR.append("]");
json.put("chartDataSource", JSON_STR.toString());
}
}
/**
* 拼装统计报表 柱状图 json yahooYui
*
* @param json
* @param res
* @throws UnsupportedEncodingException
* @throws Exception
*/
/*public void fetchSingleExerciseDetailChartData(JSONObject json,GetSingleExerciseDetailResponse res) throws UnsupportedEncodingException
{
StringBuffer JSON_STR = new StringBuffer();
if( null != res.getDetails() && res.getDetails().size() > 0 )
{
JSON_STR.append("[");
String a_str = "{ category:'A', ";
String b_str = "{ category:'B', ";
String c_str = "{ category:'C', ";
String d_str = "{ category:'D', ";
String e_str = "{ category:'E', ";
for( int i=0; i<res.getDetails().size(); i++)
{
SingleExerciseDetail single = res.getDetails().get(i);
a_str += "set"+i+" : "+single.getPercentA()+",";
b_str += "set"+i+" : "+single.getPercentB()+",";
c_str += "set"+i+" : "+single.getPercentC()+",";
d_str += "set"+i+" : "+single.getPercentD()+",";
e_str += "set"+i+" : "+single.getPercentE()+",";
}
a_str = a_str.substring(0,a_str.length()-1) + "},";
b_str = b_str.substring(0,b_str.length()-1) + "},";
c_str = c_str.substring(0,c_str.length()-1) + "},";
d_str = d_str.substring(0,d_str.length()-1) + "},";
e_str = e_str.substring(0,e_str.length()-1) + "}";
JSON_STR.append(a_str);
JSON_STR.append(b_str);
JSON_STR.append(c_str);
JSON_STR.append(d_str);
JSON_STR.append(e_str);
JSON_STR.append("]");
json.put("chartDataNum", res.getDetails().size());
json.put("chartDataSource", JSON_STR.toString());
}
}
<!-- yahooyui start -->
<script src="<%=baseurl%>/js/yui/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script src="<%=baseurl%>/js/yui/build/element/element-min.js"></script>
<script src="<%=baseurl%>/js/yui/build/datasource/datasource-min.js"></script>
<script src="<%=baseurl%>/js/yui/build/json/json-min.js"></script>
<script src="<%=baseurl%>/js/yui/build/swf/swf-min.js"></script>
<script src="<%=baseurl%>/js/yui/build/connection/connection-min.js"></script>
<script src="<%=baseurl%>/js/yui/build/charts/charts-min.js"></script>
<style type="text/css">
#chartdiv {
width: 1000px;
height: 400px;
}
.chart_title {
display: block;
font-size: 2.2em;
font-weight: bold;
margin-bottom: 0.4em;
text-align:center;
}
</style>
<!-- yahooyui end -->
//页面图形展示 饼图
if(data.chartDataSource!=null){
YAHOO.widget.Chart.SWFURL = "${ctx}/js/yui/build/charts/assets/charts.swf";
var chartJson = eval(data.chartDataSource);
var myDataSource = new YAHOO.util.DataSource(chartJson);
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
myDataSource.responseSchema = {
fields: [ "response", "count" ]
};
var mychart = new YAHOO.widget.PieChart( "chartdiv", myDataSource,
{
dataField: "count",
categoryField: "response",
style:
{
padding: 20,
legend:
{
display: "right",
padding: 10,
spacing: 5,
font:
{
family: "Arial",
size: 13
}
}
}
});
}
//页面图形展示 柱状图
if(data.chartDataSource!=null){
YAHOO.widget.Chart.SWFURL = "${ctx}/js/yui/build/charts/assets/charts.swf";
var _fields = "['category'," ;
var _seriesDef = "[" ;
for(i=0; i<data.chartDataNum; i++){
if(i==(data.chartDataNum-1)){
_fields += "'set"+i+"'";
_seriesDef += "{displayName: '',yField: 'set"+i+"',style:{size:10} }";
}else{
_fields += "'set"+i+"',";
_seriesDef += "{displayName: '',yField: 'set"+i+"',style:{size:10} },";
}
}
_fields += "]";
_seriesDef += "]";
_fields = eval(_fields);
_seriesDef = eval(_seriesDef);
var chartJson = eval(data.chartDataSource);
var myDataSource = new YAHOO.util.DataSource(chartJson);
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
myDataSource.responseSchema = {
fields: _fields
};
var mychart = new YAHOO.widget.ColumnChart( "chartdiv", myDataSource,
{
xField: "category",
series: _seriesDef,
polling: 10000
});
}
分享到:
相关推荐
JavaReport-V3-Enterprise-Released.第四卷
sonar-pdfreport-plugin-4.0.1英文pdf报告版,适用于SonarQube9.x版本 sonarQube 9.9.2-community 和postgres 13使用完全正常
sonar-pdfreport-plugin 已经对static 下 download.js 错误路径进行修改 sonar-pdf-plugin 3.0.3 适用SONARQUBE6.3+ ,生成 sonarqube 项目报告 report ,2积分好事成双,免去打包浪费时间
转pdf插件
使用方法:解压后将对应版本的report-template目录复制并替换apache-jmeter-x.x\bin\report-template目录即可,新生成的报告就被汉化了。 如果生成的html报告显示中文乱码,自行将模板文件转存合适的编码格式...
sonarqube插件:sonar-pdfreport-plugin-3.0.1.jar 1)支持sonarqube server 6.X,7.X 2)下载下来之后传到sonarqube安装目录下的extensions/plugins/目录下,然后重启sonarqube server即可 3)可以通过tailf ...
JavaReport是一款专业的报表打印工具,尤其在企业级应用中广泛使用。这个名为"javareport打印报表.rar"的压缩包包含的是JavaReport V3企业版的发布版本,根据描述,这个版本是经过验证可以正常使用的,相较于网络上...
放到WEB-INF/lib目录,发现不会自动引入,手动引入后,调用java report的程序不报错,但服务器出现放频繁出现it is not java class的错误提示。后来把他从WEB-INF/lib目录删除,自建立一个lib,手动导入。问题才解决...
sonarqube插件:sonar-pdfreport-plugin-3.0.1.jar 1)支持sonarqube server 6.X,7.X 2)下载下来之后传到sonarqube安装目录下的extensions/plugins/目录下,然后重启sonarqube server即可 3)可以通过tailf ...
maven-surefire-report-plugin-2.3.1.jar
JavaReport-V3-Enterprise-Released,第三卷...
sonarqube PDF导出插件英文版,适用SonarQube版本 : 5.5--9.9
const reportTo = require ( 'report-to' ) // ... app . use ( reportTo ( { groups : [ { group : "endpoint-1" , max_age : 10_886_400 , include_subdomains : true , endpoints : [ { url : ...
JavaReport提供了丰富的应用程序接口、减少代码复用、灵活的图表形式、即时图表生成、更短的生成时间等。Java报表对图表有良好的支持,可以生成柱图、饼图和折线图等十几种图表。
maven-surefire-report-plugin-2.0.jar
maven-surefire-report-plugin-2.3.jar
解压这个压缩包后,我们需要将其中的“report-template”文件夹移动到JMeter安装目录下的“bin”目录。这个操作是汉化报告模板的关键步骤,确保JMeter在生成报告时能够加载并显示中文界面。 JMeter的报告功能,也...
《Android系统故障报告详解——基于bugreport-LIO-AN00m-HUAWEILIO-AN00m-2022-09-16-15-08-12.zip》 在Android系统中,当遇到性能问题、应用崩溃或系统不稳定的情况时,开发者或技术支持人员通常会要求用户提供...
程序数据集
labview-report-demo#4.zip源码Labview个人项目资料程序资源下载labview-report-demo#4.zip源码Labview个人项目资料程序资源下载labview-report-demo#4.zip源码Labview个人项目资料程序资源下载labview-report-demo#...