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


Java Options.setChartOptions方法代码示例

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


在下文中一共展示了Options.setChartOptions方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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包/类
/**
 * 
 * @param 
 * @return
 */
public Options getChartOptions(List<SonarMetricMeasurement> metrics ){			
		
		String group;
		if (settings.get("metric") == null) {
			group = "Code Lines related";
		} else {
			group = settings.get("metric");
		}
		
		// get latest
		List<SonarMetricMeasurement> latestMetrics = getLatestMetricDataSet(metrics);
		List<SonarMetricMeasurement> metricGroup = getMetricsForGroup(group, latestMetrics);
	
		Options options = new Options();
		ChartOptions chartOptions =  new ChartOptions();
		SeriesType seriesType = SeriesType.COLUMN; 
		chartOptions.setType(seriesType);    
		Title chartTitle = new Title(title + " of " + group + " Metrics");
		options.setTitle(chartTitle);

		for(SonarMetricMeasurement metric: metricGroup){				
			PointSeries series = new PointSeries();	
			series.setType(seriesType);
			series.addPoint(new Point(metric.getSonarMetric(), new Double(metric.getValue())));
			series.setName(metric.getSonarMetric());
			options.addSeries(series);
		}
		options.setChartOptions(chartOptions);	
		
		return options;
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:37,代码来源:SonarQualityWidget.java

示例3: getChartOptionsDifferently

import com.googlecode.wickedcharts.highcharts.options.Options; //导入方法依赖的package包/类
public Options getChartOptionsDifferently(List<SonarMetricMeasurement> metrics,String individualMetric) {

        String group;
        if (settings.get("metric") == null) {
            group = "Code Lines related";
        } else {
            group = settings.get("metric");
        }

        // get latest
        //List<SonarMetricMeasurement> latestMetrics = getLatestMetricDataSet(metrics);
       // List<SonarMetricMeasurement> metricGroup = getMetricsForGroup(group, latestMetrics);

        Options options = new Options();
        ChartOptions chartOptions = new ChartOptions();
        SeriesType seriesType = SeriesType.COLUMN;
        chartOptions.setType(seriesType);
        Title chartTitle = new Title(title + " of " + group + " Metrics");
        options.setTitle(chartTitle);

        for (SonarMetricMeasurement metric : metrics) {
            
            if(metric.getSonarMetric().compareToIgnoreCase(individualMetric) == 0){
            PointSeries series = new PointSeries();
            series.setType(seriesType);
            series.addPoint(new Point(metric.getSonarMetric(), new Double(metric.getValue())));
            series.setName(metric.getSonarMetric());
            options.addSeries(series);
            }
        }
        options.setChartOptions(chartOptions);

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

示例4: getChartOptions

import com.googlecode.wickedcharts.highcharts.options.Options; //导入方法依赖的package包/类
/**
 * 
 * @param
 * @return
 */
private Options getChartOptions() {

    Options options = new Options();
    options.setChartOptions(new ChartOptions().setType(SeriesType.valueOf(chartType)));
    options.setTitle(new Title("Jira Metrics (" + timeInterval + ")"));
    options.setxAxis(new Axis().setCategories(UQasarUtil.getJiraMetricNamesAbbreviated()));
    options.setyAxis(new Axis().setTitle(new Title("Number of issues")));

    List<Number> resItems = new ArrayList<>();
    for (JiraMetricMeasurement jiraMeasurement : measurements) {
        int count;
        try {
            if (timeInterval.compareToIgnoreCase("Latest") == 0) {
                count = getDataService().countMeasurementsPerProjectByMetricWithLatestDate(project,
                    jiraMeasurement.getJiraMetric());
            }
            count = getDataService().countMeasurementsPerProjectByMetricWithinPeriod(project,
                jiraMeasurement.getJiraMetric(), timeInterval);
            resItems.add(count);
        } catch (uQasarException e1) {
            e1.printStackTrace();
        }
    }

    options.addSeries(new SimpleSeries().setName("Jira Data").setData(resItems));

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

示例5: getChartOptionsDifferently

import com.googlecode.wickedcharts.highcharts.options.Options; //导入方法依赖的package包/类
/**
 * 
 * @param
 * @return
 */
private Options getChartOptionsDifferently() {

    Options options = new Options();
    options.setChartOptions(new ChartOptions().setType(SeriesType.valueOf(chartType)));
    options.setTitle(new Title("Jira Metrics (" + timeInterval + ")"));
    options.setxAxis(new Axis().setCategories(UQasarUtil.getJiraMetricNamesAbbreviated()));
    options.setyAxis(new Axis().setTitle(new Title("Number of issues")));

    List<Number> resItems = new ArrayList<>();
    for (JiraMetricMeasurement jiraMeasurement : measurements) {

        if (jiraMeasurement.getJiraMetric().equals(individualMetric)) {
            int count;
            try {
                if (timeInterval.compareToIgnoreCase("Latest") == 0) {
                    count = getDataService().countMeasurementsPerProjectByMetricWithLatestDate(project,
                        jiraMeasurement.getJiraMetric());
                }
                count = getDataService().countMeasurementsPerProjectByMetricWithinPeriod(project,
                    jiraMeasurement.getJiraMetric(), timeInterval);
                resItems.add(count);
            } catch (uQasarException e1) {
                e1.printStackTrace();
            }
        }
    }

    options.addSeries(new SimpleSeries().setName("Jira Data").setData(resItems));

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

示例6: copyRenderTo

import com.googlecode.wickedcharts.highcharts.options.Options; //导入方法依赖的package包/类
/**
 * Copies the renderTo configuration from one {@link Options} object to
 * another. Null-safe.
 */
public void copyRenderTo(final Options from, final Options to) {
	if (to.getChartOptions() == null) {
		to.setChartOptions(new ChartOptions());
	}
	to.getChartOptions().setRenderTo(from.getChartOptions().getRenderTo());
}
 
开发者ID:PkayJava,项目名称:pluggable,代码行数:11,代码来源:OptionsUtil.java

示例7: setRenderTo

import com.googlecode.wickedcharts.highcharts.options.Options; //导入方法依赖的package包/类
/**
 * Null-safe setter for the renderTo configuration.
 */
public void setRenderTo(final Options options, final String renderTo) {
	if (options.getChartOptions() == null) {
		options.setChartOptions(new ChartOptions());
	}
	options.getChartOptions().setRenderTo(renderTo);
}
 
开发者ID:PkayJava,项目名称:pluggable,代码行数:10,代码来源:OptionsUtil.java

示例8: setChartEventsLoad

import com.googlecode.wickedcharts.highcharts.options.Options; //导入方法依赖的package包/类
/**
 * Null-safe setter for the chart.events.load configuration.
 */
public void setChartEventsLoad(final Options options, final Function function) {
	if (options.getChartOptions() == null) {
		options.setChartOptions(new ChartOptions());
	}
	if (options.getChartOptions().getEvents() == null) {
		options.getChartOptions().setEvents(new Events());
	}
	if (options.getChartOptions().getEvents().getLoad() == null) {
		options.getChartOptions().getEvents().setLoad(function);
	}
}
 
开发者ID:PkayJava,项目名称:pluggable,代码行数:15,代码来源:OptionsUtil.java

示例9: createChartValue

import com.googlecode.wickedcharts.highcharts.options.Options; //导入方法依赖的package包/类
private WickedChart createChartValue(String title, List<String> titles, List<Number> values, Number min, Number max) {
    Options options = new Options();
    options.setChartOptions(new ChartOptions().setType(SeriesType.COLUMN));
    
    options.setTitle(new Title(title));
    
    options.setxAxis(new Axis().setCategories(titles));
    options.setyAxis(new Axis().setMin(min).setMax(max));
    
    options.setLegend(
            new Legend()
                .setLayout(LegendLayout.VERTICAL)
                .setBackgroundColor(new HexColor("#FFFFFF"))
                .setAlign(HorizontalAlignment.LEFT)
                .setVerticalAlign(VerticalAlignment.TOP).setX(100).setY(70).setFloating(Boolean.TRUE).setShadow(Boolean.TRUE));
    
    options.setTooltip(
            new Tooltip().setFormatter(new Function().setFunction(" return ''+ this.x +': '+ this.y;")));
    
    options.setPlotOptions(
            new PlotOptionsChoice()
                .setColumn(new PlotOptions().setPointPadding(0.2f).setBorderWidth(0)));
    
    Series<Number> setData = new SimpleSeries().setName("Value").setData(values);
    options.addSeries(setData);
    
    return new WickedChart(options);
}
 
开发者ID:isisaddons-legacy,项目名称:isis-wicket-wickedcharts,代码行数:29,代码来源:CollectionContentsAsSummaryCharts.java

示例10: 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

示例11: getOptionsForHistoricalChart

import com.googlecode.wickedcharts.highcharts.options.Options; //导入方法依赖的package包/类
/**
 * 
 * @return
 */
public Options getOptionsForHistoricalChart() {
	
	TreeNodeService dataService = null;
	Project proj = null;
	try {
		InitialContext ic = new InitialContext();
		dataService = (TreeNodeService) ic.lookup("java:module/TreeNodeService");			
		// Obtain project from the settings
		if (settings.get("project") != null) {
			proj = dataService.getProjectByName(settings.get("project"));
		} else {
			if (dataService != null) {
				proj = dataService.getProjectByName("U-QASAR Platform Development");			
			}				
		}
	} catch (NamingException e) {
		e.printStackTrace();
	}

	
	Options options = new Options();
	ChartOptions chartOptions =  new ChartOptions();

	// Obtain the historic values for the project
	List<HistoricValuesProject> projectHistoricvalues = getHistoricalValues(proj);
	Collections.sort(projectHistoricvalues);
	
	
	SeriesType seriesType = SeriesType.LINE; 
	chartOptions.setType(seriesType);    
	options.setTitle(new Title("Historical Project Quality"));
	
	PointSeries series = new PointSeries();	
	series.setType(seriesType);

	List<String> xAxisLabels = new ArrayList<>();

	for (HistoricValuesProject historicValue : projectHistoricvalues) {
		float value = historicValue.getValue();
		System.out.println("Value: " +value);
		series.addPoint(new Point(proj.getAbbreviatedName(), value));			

		// xAxis Label
		Date date = historicValue.getDate();
		SimpleDateFormat dt1 = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss");
		xAxisLabels.add(dt1.format(date));
	}
	
	// Date on xAxis
	Axis xAxis = new Axis();
	xAxis.setType(AxisType.DATETIME);
	xAxis.setCategories(xAxisLabels);
	xAxis.setLabels(new Labels()
            .setRotation(-60)
            .setAlign(HorizontalAlignment.RIGHT)
            .setStyle(new CssStyle()
                .setProperty("font-size", "9px")
                .setProperty("font-family", "Verdana, sans-serif")));
	options.setxAxis(xAxis);	
	
	options.addyAxis(new Axis()
	.setMin(0)
	.setMax(100));
	
	options.addSeries(series);
	options.setChartOptions(chartOptions);
	
	return options;
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:74,代码来源:ProjectQualityChartWidget.java

示例12: 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

示例13: getChartOptions

import com.googlecode.wickedcharts.highcharts.options.Options; //导入方法依赖的package包/类
/**
 * 
 * @param metrics
 * @return
 */
public Options getChartOptions(List<TestLinkMetricMeasurement> metrics) {

	Options options = new Options();
	ChartOptions chartOptions =  new ChartOptions();
	SeriesType seriesType = SeriesType.PIE; 
	chartOptions.setType(seriesType);    
	Title chartTitle = new Title("Total " + title + ": " + getTotalMetric(metrics));
	options.setTitle(chartTitle);		
	PointSeries series = new PointSeries();	
	series.setType(seriesType);

	// remove TOTAL metric	
	List<TestLinkMetricMeasurement> noTotal = removeTotalMetric(metrics); 
	if (noTotal != null && !noTotal.isEmpty()) {
		int items = 4;
		if (noTotal.size() < items) {
			items = noTotal.size();
		}
			// we obtain the metrics, sorted by timestamp (descending)
			for (int tlm= 0; tlm < items; tlm++){				
				TestLinkMetricMeasurement metric = noTotal.get(tlm);
                   switch (metric.getTestLinkMetric()) {
                       case "TEST_P":
                           series.addPoint(new Point("Tests Passed", new Double(metric.getValue())));
                           break;
                       case "TEST_F":
                           series.addPoint(new Point("Tests Failed", new Double(metric.getValue())));
                           break;
                       case "TEST_B":
                           series.addPoint(new Point("Tests Blocking", new Double(metric.getValue())));
                           break;
                       default:
                           series.addPoint(new Point("Tests Not Executed", new Double(metric.getValue())));
                           break;
                   }
			}
		options.addSeries(series);
		options.setChartOptions(chartOptions);					
	}

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

示例14: getChartOptionsDifferently

import com.googlecode.wickedcharts.highcharts.options.Options; //导入方法依赖的package包/类
/**
 * 
 * @param metrics
 * @return
 */
public Options getChartOptionsDifferently(List<TestLinkMetricMeasurement> metrics,String individualMetric) {

    Options options = new Options();
    ChartOptions chartOptions =  new ChartOptions();
    SeriesType seriesType = SeriesType.PIE; 
    chartOptions.setType(seriesType);    
    Title chartTitle = new Title("Total " + title + ": " + getTotalMetric(metrics));
    options.setTitle(chartTitle);       
    PointSeries series = new PointSeries(); 
    series.setType(seriesType);

    // remove TOTAL metric  
    List<TestLinkMetricMeasurement> noTotal = removeExtraMetrics(metrics,individualMetric); 
    if (noTotal != null && !noTotal.isEmpty()) {
        int items = 4;
        if (noTotal.size() < items) {
            items = noTotal.size();
        }
            // we obtain the metrics, sorted by timestamp (descending)
            for (int tlm= 0; tlm < items; tlm++){               
                TestLinkMetricMeasurement metric = noTotal.get(tlm);
                switch (metric.getTestLinkMetric()) {
                    case "TEST_P":
                        series.addPoint(new Point("Tests Passed", new Double(metric.getValue())));
                        break;
                    case "TEST_F":
                        series.addPoint(new Point("Tests Failed", new Double(metric.getValue())));
                        break;
                    case "TEST_B":
                        series.addPoint(new Point("Tests Blocking", new Double(metric.getValue())));
                        break;
                    default:
                        series.addPoint(new Point("Tests Not Executed", new Double(metric.getValue())));
                        break;
                }
            }
        options.addSeries(series);
        options.setChartOptions(chartOptions);                  
    }

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

示例15: createOptions

import com.googlecode.wickedcharts.highcharts.options.Options; //导入方法依赖的package包/类
Options createOptions() {
    Options options = new Options();

    options.setChartOptions(new ChartOptions().setType(SeriesType.LINE));

    options.setTitle(new Title("My very own chart."));

    options.setxAxis(new Axis().setCategories(Arrays.asList(new String[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" })));

    options.setyAxis(new Axis().setTitle(new Title("Temperature (C)")));

    options.setLegend(new Legend().setLayout(LegendLayout.VERTICAL).setAlign(HorizontalAlignment.RIGHT).setVerticalAlign(VerticalAlignment.TOP).setX(-10).setY(100).setBorderWidth(0));

    options.addSeries(new SimpleSeries().setName("Tokyo").setData(Arrays.asList(new Number[] { 7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6 })));

    options.addSeries(new SimpleSeries().setName("New York").setData(Arrays.asList(new Number[] { -0.2, 0.8, 5.7, 11.3, 17.0, 22.0, 24.8, 24.1, 20.1, 14.1, 8.6, 2.5 })));
    return options;
}
 
开发者ID:isisaddons-legacy,项目名称:isis-wicket-wickedcharts,代码行数:19,代码来源:WicketChartSemanticsProviderEncoderDecoderTest.java


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