<%
List tjList = (List)request.getAttribute("resultList");
Map sumMap = (Map)request.getAttribute("sumMap");double[] data0 = null;
double[] data1 = null;
//double[] data2 = null;
String[] labels = null;
data0 = new double[tjList.size()];
data1 = new double[tjList.size()];
//data2 = new double[tjList.size()];
labels = new String[tjList.size()];
Map map = null;
for (int i = 0; i < tjList.size(); i++) {
map = (Map) tjList.get(i);
System.out.println(map.get("MC").toString().substring(3,5));;
data0[i] = Double.parseDouble(map.get("XZ").toString());
data1[i] = Double.parseDouble(map.get("ZX").toString());
labels[i] =map.get("MC").toString().substring(3,5);
}
XYChart c = new XYChart(labels.length*35, 459);c.setPlotArea(65, 40, labels.length*35, 379,
0xffffff, 0xf8f8f8, Chart.Transparent, c.dashLineColor(0xcccccc, Chart.DotLine), c.dashLineColor(0xcccccc, Chart.DotLine)
);
c.addLegend(30, 5, false, "simsun.ttc bold", 9).setBackground(Chart.Transparent);
c.xAxis().setLabels(labels);
c.xAxis().setLabelStyle("Arial bold", 8);
c.yAxis().setLabelStyle("Arial Bold", 8);c.xAxis().setWidth(2);
c.yAxis().setWidth(2);c.yAxis().setTitle("","simsum.ttc bold", 10);LineLayer layer = c.addLineLayer2();
layer.setLineWidth(2);
layer.addDataSet(data0, 0x22d941, "");
layer.addDataSet(data1, 0xff0000, ""); layer.setDataLabelFormat("{value}");
TextBox t = layer.setDataLabelStyle();
t.setBackground(Chart.SameAsMainColor, Chart.Transparent, Chart.glassEffect());
t.setRoundedCorners(5);// output the chart
String chart1URL = c.makeSession(request, "jzz_chart");
// Include tool tip for the chart
String imageMap1 = c.getHTMLImageMap(
//request.getContextPath()+"/page/website/tjchart_fenju.jsp?a=a",
"",
"",
"title='{xLabel}共{dataSetName}: {value} 人'");
%>生成的X轴式方块字 这是为什么呢?
List tjList = (List)request.getAttribute("resultList");
Map sumMap = (Map)request.getAttribute("sumMap");double[] data0 = null;
double[] data1 = null;
//double[] data2 = null;
String[] labels = null;
data0 = new double[tjList.size()];
data1 = new double[tjList.size()];
//data2 = new double[tjList.size()];
labels = new String[tjList.size()];
Map map = null;
for (int i = 0; i < tjList.size(); i++) {
map = (Map) tjList.get(i);
System.out.println(map.get("MC").toString().substring(3,5));;
data0[i] = Double.parseDouble(map.get("XZ").toString());
data1[i] = Double.parseDouble(map.get("ZX").toString());
labels[i] =map.get("MC").toString().substring(3,5);
}
XYChart c = new XYChart(labels.length*35, 459);c.setPlotArea(65, 40, labels.length*35, 379,
0xffffff, 0xf8f8f8, Chart.Transparent, c.dashLineColor(0xcccccc, Chart.DotLine), c.dashLineColor(0xcccccc, Chart.DotLine)
);
c.addLegend(30, 5, false, "simsun.ttc bold", 9).setBackground(Chart.Transparent);
c.xAxis().setLabels(labels);
c.xAxis().setLabelStyle("Arial bold", 8);
c.yAxis().setLabelStyle("Arial Bold", 8);c.xAxis().setWidth(2);
c.yAxis().setWidth(2);c.yAxis().setTitle("","simsum.ttc bold", 10);LineLayer layer = c.addLineLayer2();
layer.setLineWidth(2);
layer.addDataSet(data0, 0x22d941, "");
layer.addDataSet(data1, 0xff0000, ""); layer.setDataLabelFormat("{value}");
TextBox t = layer.setDataLabelStyle();
t.setBackground(Chart.SameAsMainColor, Chart.Transparent, Chart.glassEffect());
t.setRoundedCorners(5);// output the chart
String chart1URL = c.makeSession(request, "jzz_chart");
// Include tool tip for the chart
String imageMap1 = c.getHTMLImageMap(
//request.getContextPath()+"/page/website/tjchart_fenju.jsp?a=a",
"",
"",
"title='{xLabel}共{dataSetName}: {value} 人'");
%>生成的X轴式方块字 这是为什么呢?
解决方案 »
- j2ee turorial6的问题
- 请问前辈coder这条路该怎么走呢?
- Struts2中无法用$()得到属性值
- webservice 的作业 各位大哥帮看看- JDeveloper SOAP/JDBC/XML Application
- 学习j2ee应该买书看,还是看电子书?
- 高手进来:怎样得到一个表中的某个字段的字段类型
- 请教一个Hibernate的NoInitialContextException问题
- 怎么会报这个错!各位高人来帮我看看?
- import javax.servlet.http ?
- 请大家推荐几个struts入门的好书或好站点,目前中文资料太少
- 急,struts1.2.9 DispatchAction转向问题 无法访问此action 中的其他forward 总是转向input指向的路径
- 一个小许复杂的逻辑获取XML 请教
String[] labelsUser = { "测试1", "xx", "xx", "xx" };
XYChart userChart = new XYChart(260, 160);
userChart.setPlotArea(30, 20, 210, 120, userChart.linearGradientColor(
30, 20, 10, 150, 0xeeeeff, 0x0000cc), -1, 0xffffff, 0xffffff);
// set backgroud
userChart.setBackground(userChart.linearGradientColor(0, 0, 0, 90,
0xaeebfa, 0xebfaeb), Chart.Transparent);
userChart.setDefaultFonts("SIMSUN.TTC","simhei.ttf");
userChart.xAxis().setLabels(labelsUser);
c.xAxis().setLabelStyle("Arial bold", 8);
c.yAxis().setLabelStyle("Arial Bold", 8);
将Arial bold 改成 宋体 就可以了 但这是在window下可以 在Linux 系统下 上面的写法是完全正确的