本文整理汇总了Java中com.googlecode.wickedcharts.highcharts.options.Options类的典型用法代码示例。如果您正苦于以下问题:Java Options类的具体用法?Java Options怎么用?Java Options使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Options类属于com.googlecode.wickedcharts.highcharts.options包,在下文中一共展示了Options类的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;
}
示例2: getPointWithWickedChartsId
import com.googlecode.wickedcharts.highcharts.options.Options; //导入依赖的package包/类
/**
* Retrieves the {@link Point} object with the given wickedChartsId from the
* given {@link Options} object. Returns null if a Point with the given ID
* does not exist.
*/
public static Point getPointWithWickedChartsId(final Options options, final int wickedChartsId) {
for (Series<?> series : options.getSeries()) {
for (Object object : series.getData()) {
if (!(object instanceof Point)) {
break;
} else {
Point point = (Point) object;
if (point.getWickedChartsId() == wickedChartsId) {
return point;
}
}
}
}
return null;
}
示例3: processOptions
import com.googlecode.wickedcharts.highcharts.options.Options; //导入依赖的package包/类
@Override
public void processOptions(final Options options, final OptionsProcessorContext context) {
List<IProcessableOption> processables = options.getMarkedForProcessing(LiveDataSeries.PROCESSING_KEY);
LiveDataFunction function = new LiveDataFunction();
if (processables.size() > 1) {
throw new RuntimeException("Only one LiveDataSeries per chart allowed!");
}
for (IProcessableOption processable : processables) {
LiveDataSeries series = (LiveDataSeries) processable;
LiveDataAjaxBehavior behavior = getBehaviorFromComponent(this.component, series);
if (behavior == null) {
behavior = new LiveDataAjaxBehavior(series);
this.component.add(behavior);
}
behavior.addJavaScriptValues(series.getJavaScriptParameters());
function.addLiveDataSeries(options, behavior);
}
OptionsUtil.getInstance().setChartEventsLoad(options, function);
}
示例4: processOptions
import com.googlecode.wickedcharts.highcharts.options.Options; //导入依赖的package包/类
@Override
public void processOptions(final Options options, final OptionsProcessorContext context) {
List<SelectionFunction> functions = context.getSelectionFunctions();
for (final SelectionFunction function : functions) {
// add server side AJAX event
SelectionBehavior selectionBehavior = new SelectionBehavior() {
@Override
public void onSelection(final SelectionEvent event, final AjaxRequestTarget target) {
WicketSelectionEvent wicketEvent = new WicketSelectionEvent(target, event);
function.onSelect(wicketEvent);
}
};
this.chart.add(selectionBehavior);
// add client side javascript to trigger an AJAX call
String functionBody = selectionBehavior.getCallbackScript().toString();
function.setFunction(functionBody);
}
}
示例5: renderHead
import com.googlecode.wickedcharts.highcharts.options.Options; //导入依赖的package包/类
@Override
public void renderHead(final Component component, final IHeaderResponse response) {
component.setOutputMarkupId(true);
Options options = this.chart.getOptions();
final String id = component.getMarkupId();
OptionsUtil.getInstance().setRenderTo(options, id);
JsonRenderer renderer = JsonRendererFactory.getInstance().getRenderer();
includeJavascriptDependencies(response, options);
addTheme(response, renderer);
OptionsProcessorContext context = new OptionsProcessorContext(options);
DrilldownProcessor drilldownProcessor = new DrilldownProcessor(component, response);
drilldownProcessor.processOptions(options, context);
GlobalProcessor globalProcessor = new GlobalProcessor(response);
globalProcessor.processOptions(options, context);
includeChartJavascript(response, options, renderer, id);
}
示例6: addDrilldownFunction
import com.googlecode.wickedcharts.highcharts.options.Options; //导入依赖的package包/类
/**
* Adds a {@link DrilldownFunction} to the {@link PlotOptions} of the given
* {@link Options}.
*
* @param options
* the {@link Options} to add a {@link DrilldownFunction} to
*/
private void addDrilldownFunction(Options options, OptionsProcessorContext context) {
SeriesType chartType = options.getChartOptions().getType();
if (options.getPlotOptions() == null) {
options.setPlotOptions(new PlotOptionsChoice());
}
if (options.getPlotOptions().getPlotOptions(chartType) == null) {
options.getPlotOptions().setPlotOptions(new PlotOptions(), chartType);
}
if (options.getPlotOptions().getPlotOptions(chartType).getPoint() == null) {
options.getPlotOptions().getPlotOptions(chartType).setPoint(new PointOptions());
}
if (options.getPlotOptions().getPlotOptions(chartType).getPoint().getEvents() == null) {
options.getPlotOptions().getPlotOptions(chartType).getPoint().setEvents(new Events());
}
options.getPlotOptions().getPlotOptions(chartType).getPoint().getEvents()
.setClick(new DrilldownFunction(getDrilldownArrayName(component)));
}
示例7: respond
import com.googlecode.wickedcharts.highcharts.options.Options; //导入依赖的package包/类
@Override
protected void respond(final AjaxRequestTarget target) {
Chart chart = (Chart) getComponent();
Options options = chart.getOptions();
InteractionEvent event = new InteractionEvent();
event.setJavascriptChartName(chart.getJavaScriptVarName());
StringValue selectedPointValue = getVariableValue(SELECTED_POINT);
if (selectedPointValue != null && !"".equals(selectedPointValue.toString())) {
Integer selectedPoint = selectedPointValue.toInteger();
Point point = OptionsUtil.getPointWithWickedChartsId(options, selectedPoint);
event.setSelectedPoint(point);
}
StringValue selectedSeriesValue = getVariableValue(SELECTED_SERIES);
if (selectedSeriesValue != null && !"".equals(selectedSeriesValue.toString())) {
Integer selectedSeries = selectedSeriesValue.toInteger();
Series<?> series = OptionsUtil.getSeriesWithWickedChartsId(options, selectedSeries);
event.setSelectedSeries(series);
}
event.setSelectedChart(options);
onEvent(event, target);
}
示例8: processOptions
import com.googlecode.wickedcharts.highcharts.options.Options; //导入依赖的package包/类
@Override
public void processOptions(final Options options, final OptionsProcessorContext context) {
List<InteractionFunction> functions = context.getInteractionFunctions();
for (final InteractionFunction function : functions) {
// add server side AJAX event
InteractionBehavior interactionBehavior = new InteractionBehavior() {
@Override
public void onEvent(final InteractionEvent event, final AjaxRequestTarget target) {
WicketInteractionEvent wicketEvent = new WicketInteractionEvent(target, event);
function.onInteraction(wicketEvent);
}
};
this.chart.add(interactionBehavior);
// add client side javascript to trigger an AJAX call
String functionBody = interactionBehavior.getCallbackScript().toString();
function.setFunction(functionBody);
}
}
示例9: createChartBehavior
import com.googlecode.wickedcharts.highcharts.options.Options; //导入依赖的package包/类
/**
* Hack to make it run a StockChart instead of normal Chart.
*/
@Override
protected ChartBehavior createChartBehavior() {
return new ChartBehavior(this) {
@Override
protected void includeChartJavascript(final IHeaderResponse response, final Options options,
final JsonRenderer renderer, final String markupId) {
final String chartVarname = RefreshingStockChart.this.getJavaScriptVarName();
final String optionsVarname = markupId + "Options";
response.render(OnDomReadyHeaderItem.forScript(
MessageFormat.format("var {0} = {1};window.{2} = new Highcharts.StockChart({0});",
optionsVarname, renderer.toJson(options), chartVarname)));
}
};
}
示例10: 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;
}
示例11: 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;
}
示例12: 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;
}
示例13: 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;
}
示例14: historicChart
import com.googlecode.wickedcharts.highcharts.options.Options; //导入依赖的package包/类
/**
* @return Returns a graphical representation of all the values,
* thresholds and target value by date
*/
private Chart historicChart(){
Options options = new Options();
options.setTitle(new Title(project.getName()));
List<Number> values = new ArrayList<>();
List<Number> upLimit = new ArrayList<>();
List<Number> lowLimit = new ArrayList<>();
List<String> dates = new ArrayList<>();
// Prepare information to be show in the graphic
for (AbstractHistoricValues h : historicalService.getAllHistValuesForProjectAsc(projectId)) {
values.add(h.getValue());
upLimit.add(h.getUpperAcceptanceLimit());
lowLimit.add(h.getLowerAcceptanceLimit());
dates.add(new SimpleDateFormat("dd.MM.yyyy").format(h.getDate()));
}
// X Axis
Axis xAxis = new Axis();
xAxis.setCategories(dates);
options.setxAxis(xAxis);
// Y Axis
Axis yAxis = new Axis();
options.setyAxis(yAxis);
// Adding series to the graphic
options.addSeries(new SimpleSeries().setName("Value").setData(values));
options.addSeries(new SimpleSeries().setName("UpLimit").setData(upLimit));
options.addSeries(new SimpleSeries().setName("LowLimit").setData(lowLimit));
// Legend
Legend legend = new Legend();
legend.setBorderWidth(0);
options.setLegend(legend);
return new Chart("chart",options);
}
示例15: OptionsProcessorContext
import com.googlecode.wickedcharts.highcharts.options.Options; //导入依赖的package包/类
public OptionsProcessorContext(final Options options) {
collectDrilldownOptions(options);
collectLiveDataSeries(options);
collectInteractionFunctions(options);
collectSelectionFunctions(options);
this.global = options.getGlobal();
}