当前位置: 首页>>代码示例>>Java>>正文


Java Options.setSubtitle方法代码示例

本文整理汇总了Java中com.googlecode.wickedcharts.highcharts.options.Options.setSubtitle方法的典型用法代码示例。如果您正苦于以下问题:Java Options.setSubtitle方法的具体用法?Java Options.setSubtitle怎么用?Java Options.setSubtitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.googlecode.wickedcharts.highcharts.options.Options的用法示例。


在下文中一共展示了Options.setSubtitle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTrafficLightOptions

import com.googlecode.wickedcharts.highcharts.options.Options; //导入方法依赖的package包/类
private Options getTrafficLightOptions(){
	Options options = new Options();
	if(lastBuildSuccess != null){
	    HexColor color = getTrafficLightColor(lastBuildSuccess.getValue());
	
   		options.setChartOptions(new ChartOptions()
   	        .setPlotBackgroundColor(new NullColor())
   	        .setPlotBorderWidth(null)
   	        .setHeight(250)
   	        .setPlotShadow(Boolean.FALSE));
   		options.setTitle(new Title("Latest Build Status"));
   		options.setSubtitle(new Title(projectName));
   		
   		options.setPlotOptions(new PlotOptionsChoice()
   	        .setPie(new PlotOptions()
   	            .setAllowPointSelect(Boolean.FALSE)
   	            .setBorderWidth(0) // to make it look like a "traffic light"
   	            .setCursor(Cursor.POINTER)));
    
   		options.addSeries(new PointSeries()
   	        .setType(SeriesType.PIE)
   	        .addPoint(new Point(lastBuildSuccess.getValue(), 100).setColor(color)));
	}
	return options;
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:26,代码来源:JenkinsWidgetView.java

示例2: getChartOptions

import com.googlecode.wickedcharts.highcharts.options.Options; //导入方法依赖的package包/类
protected static final Options getChartOptions(final PersonProvider provider) {
    Options opts = new Options();
    opts.setTitle(new Title("Account data"));
    opts.setSubtitle(new Title("Amounts at given dates"));
    opts.setChartOptions(new ChartOptions()
            .setType(SeriesType.SPLINE));
    Axis xAxis = new Axis();
    xAxis.setType(AxisType.DATETIME);

    DateTimeLabelFormat dateTimeLabelFormat = new DateTimeLabelFormat()
            .setProperty(DateTimeLabelFormat.DateTimeProperties.MONTH, "%e. %b")
            .setProperty(DateTimeLabelFormat.DateTimeProperties.YEAR, "%b");
    xAxis.setDateTimeLabelFormats(dateTimeLabelFormat);
    opts.setxAxis(xAxis);

    Iterator<? extends Person> personIterator = provider.iterator(0, 0);
    while (personIterator.hasNext()) {
        Person person = personIterator.next();
        List<Statement> statements = person.getStatements();
        List<Coordinate<String, Double>> values = new ArrayList(statements.size());
        for (Statement stat: statements) {
            SimpleDateFormat sdf = new SimpleDateFormat("'Date.UTC(1970, 'MM', 'DD')'");
            String datestring = sdf.format(stat.getDate());
            values.add(new Coordinate<String, Double>(datestring, stat.getAmount()));
        }
        Collections.sort(values, COORD_COMPARE);
        Series series = new Series<Double>() { };
        series.setData(values);
        series.setName(person.getName());
        opts.addSeries(series);
    }
    return opts;
}
 
开发者ID:tkruse,项目名称:wickapp2,代码行数:34,代码来源:HomePage.java

示例3: getBuildHistoryOptions

import com.googlecode.wickedcharts.highcharts.options.Options; //导入方法依赖的package包/类
private Options getBuildHistoryOptions(int limitingNumber){
       Options options = new Options();
       String title = "Build History";
       options.setChartOptions(new ChartOptions().setPlotBackgroundColor(new NullColor()).setPlotBorderWidth(null)
           .setHeight(250).setPlotShadow(Boolean.FALSE));
       options.setTitle(new Title(title));
       options.setSubtitle(new Title(projectName));
       options.setPlotOptions(new PlotOptionsChoice().setPie(new PlotOptions().setAllowPointSelect(Boolean.FALSE).setCursor(
           Cursor.POINTER)));

       Series<Number> history = new SimpleSeries();
       history.setType(SeriesType.AREA);
       history.setName(title);
       // TODO:
       // y-axis: load BuildStatus from last100Builds here --> PLEASE OPTIMIZE HERE!
       // add the correct labels on the axes (0 = stable, 1=unstable, 2=broken, 3=Unknown
       // add the correct BuildNumber on the x-axis (not 0-99, but 634-734)
       List<Number> data = new ArrayList<>();
       List<String> yAxisLabels = new ArrayList<>();
       List<String> xAxisLabels = new ArrayList<>();
       
       int counter = 0;
        
       for (Map.Entry<Number, String> e : sortedLast100Builds) {
           if(counter <= limitingNumber){      //make sure the counter is smaller than limiting number
               if (e.getValue().toLowerCase().equals("stable")) {
                    data.add(0);
               } else if (e.getValue().toLowerCase().equals("unstable")) {
                    data.add(1);
               } else if (e.getValue().toLowerCase().equals("broken")) {
                    data.add(2);
               } else {
                    data.add(3);
               }
                xAxisLabels.add(String.valueOf(e.getKey()));
                counter++;
           }
       }
       history.setData(data);

       

       // Numbers on xAxis
       Axis xAxis = new Axis();
       xAxis.setType(AxisType.DATETIME);
       xAxis.setCategories(xAxisLabels);
       xAxis.setLabels(new Labels().setVerticalAlign(VerticalAlignment.BOTTOM)
           .setStyle(new CssStyle().setProperty("font-size", "10px").setProperty("font-family", "Verdana, sans-serif")));
       options.setxAxis(xAxis);

       // Labels as String on yAxis
       yAxisLabels.add("stable");
       yAxisLabels.add("unstable");
       yAxisLabels.add("broken");
       yAxisLabels.add("out-of-scope");
       Axis yAxis = new Axis();
       yAxis.setType(AxisType.DATETIME);
       yAxis.setCategories(yAxisLabels);
       yAxis.setLabels(new Labels().setVerticalAlign(VerticalAlignment.BOTTOM)
           .setStyle(new CssStyle().setProperty("font-size", "10px").setProperty("font-family", "Verdana, sans-serif")));
       options.setyAxis(yAxis);
       
        options.addSeries(history);

       return options;
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:67,代码来源:JenkinsWidgetView.java


注:本文中的com.googlecode.wickedcharts.highcharts.options.Options.setSubtitle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。