<% ... @ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> <% ... @page import="SoftwareFX.ChartFX.*" %> <% ... ChartServer chart1 = new ChartServer(application,request,response);//添加数据//(x,y,数据)chart1.openData(COD.VALUES,2,5);chart1.getValue().setItem(1,0,0.5);chart1.getValue().setItem(1,1,0.75);chart1.getValue().setItem(1,2,0.91);chart1.getValue().setItem(1,3,0.98);chart1.getValue().setItem(1,4,0.72);chart1.getValue().setItem(0,0,100000);chart1.getValue().setItem(0,1,0);chart1.getValue().setItem(0,2,655234);chart1.getValue().setItem(0,3,891230);chart1.getValue().setItem(0,4,533988);chart1.closeData(COD.VALUES);//给第一个数据设置样式SeriesAttributes series = chart1.getSeries().getItem(1);//设置成点连线short s = 5;series.setGallery(Gallery.LINES);series.setMarkerSize((short) 4);//设置线条的粗细series.setLineWidth(s);//设置线条的样式series.setLineStyle(5);//显示对应的数据series.setPointLabels(true);//给右边的Y轴设置Axis axis = chart1.getAxis().getItem(YAxis.SECONDARY); //最小纸axis.setMin((float) 0.5);//最大值axis.setMax(2);//给左边的Y轴设置axis = chart1.getAxis().getItem(YAxis.MAIN);//最大值axis.setMax(50000000);//数据根据右边的Y轴series.setYAxis(YAxis.SECONDARY); //给第二个数据设置样式series = chart1.getSeries().getItem(0);//设置成方柱型series.setGallery(Gallery.BAR);//series.setCylSides((short) 32); //设置成圆柱形。short sh = 1;//或得添加自定义字符对象。SoftwareFX.ChartFX.Annotation.AnnotationX annot = new SoftwareFX.ChartFX.Annotation.AnnotationX();chart1.getExtensions().add(annot);SoftwareFX.ChartFX.Annotation.AnnotationText text1 = new SoftwareFX.ChartFX.Annotation.AnnotationText();annot.getList().add(text1);//设置自定义字符text1.setText("안 나 라 ");text1.setDrawingArea(false);//设置颜色text1.setTextColor(java.awt.Color.black);text1.setColor(new java.awt.Color(0,0,0,0));text1.getBorder().setColor(new java.awt.Color(0,0,0,0));//设置位置//如果根据右边进行位置设定,如何text1.attach(2,90000);chart1.setImgMap(ImgMap.TITLE_TIP);chart1.setSmoothFlags(SmoothFlags.FILL | SmoothFlags.BORDER);//连线//chart1.getAxisY().setGridlines(true);//自定义给X轴的单元显示chart1.getLegend().setItem(0, "January");chart1.getLegend().setItem(1, "February");chart1.getLegend().setItem(2, "March");chart1.getLegend().setItem(3, "April");chart1.getLegend().setItem(4, "May"); %> <% = chart1.getHtmlTag( " 450 " , " 280 " , " PNG " ) %>