本文整理汇总了Java中com.googlecode.wickedcharts.highcharts.options.series.Point类的典型用法代码示例。如果您正苦于以下问题:Java Point类的具体用法?Java Point怎么用?Java Point使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Point类属于com.googlecode.wickedcharts.highcharts.options.series包,在下文中一共展示了Point类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: prepareEventSeries
import com.googlecode.wickedcharts.highcharts.options.series.Point; //导入依赖的package包/类
/**
* prepare data for diagram by calculating percentages of events by
* eventtype
*
* @return data series for pie chart
*/
private Series<Point> prepareEventSeries() {
final Series<Point> series = new PointSeries().setType(SeriesType.PIE).setName("Event Types Percentage");
// get overall number of events
final double numberOfEvents = EapEvent.getNumberOfEvents();
for (final EapEventType type : EapEventType.findAll()) {
final double numberOfEventsOfEventType = EapEvent.getNumberOfEventsByEventType(type);
double percentage = 0;
if (numberOfEvents > 0) {
// calculate percentage
percentage = numberOfEventsOfEventType / numberOfEvents;
}
series.addPoint(new Point(type.getTypeName(), Math.round(percentage * 100) / 100.0));
}
return series;
}
开发者ID:bptlab,项目名称:Unicorn,代码行数:24,代码来源:EventTypePercentageDiagramm.java
示例2: getTrafficLightOptions
import com.googlecode.wickedcharts.highcharts.options.series.Point; //导入依赖的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
示例3: getPointWithWickedChartsId
import com.googlecode.wickedcharts.highcharts.options.series.Point; //导入依赖的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;
}
开发者ID:PkayJava,项目名称:pluggable,代码行数:21,代码来源:OptionsUtil.java
示例4: respond
import com.googlecode.wickedcharts.highcharts.options.series.Point; //导入依赖的package包/类
@Override
protected void respond(final AjaxRequestTarget target) {
Chart chart = (Chart) getComponent();
int seriesIndex = OptionsUtil.getSeriesIndex(chart.getOptions(), this.series.getWickedChartsId());
LiveDataUpdateEvent event = new LiveDataUpdateEvent();
event.setJavascriptChartName(chart.getJavaScriptVarName());
event.setParameters(createJavascriptParameters());
WicketLiveDataUpdateEvent wicketEvent = new WicketLiveDataUpdateEvent(target, event);
final Point point = this.series.update(wicketEvent);
if (point != null) {
JsonRenderer renderer = JsonRendererFactory.getInstance().getRenderer();
String jsonPoint = renderer.toJson(point);
String javaScript = "var chartVarName = " + ((Chart) getComponent()).getJavaScriptVarName() + ";\n";
javaScript += "var seriesIndex = " + seriesIndex + ";\n";
javaScript += "eval(chartVarName).series[seriesIndex].addPoint(" + jsonPoint + ", true, true);\n";
target.appendJavaScript(javaScript);
}
}
开发者ID:PkayJava,项目名称:pluggable,代码行数:19,代码来源:LiveDataAjaxBehavior.java
示例5: respond
import com.googlecode.wickedcharts.highcharts.options.series.Point; //导入依赖的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);
}
开发者ID:PkayJava,项目名称:pluggable,代码行数:27,代码来源:InteractionBehavior.java
示例6: randomData
import com.googlecode.wickedcharts.highcharts.options.series.Point; //导入依赖的package包/类
private List<Point> randomData(int size, String symbol, Tick[] ticks) {
List<Point> result = new ArrayList<Point>();
Collections.reverse(Arrays.asList(ticks));
for (int i = 0; i < size; i++) {
result.add(new Point().setX(ticks[i].getTimestamp().getTime())
.setY(ticks[i].getPrice()));
// time += 1000;
}
return result;
}
开发者ID:sgrotz,项目名称:myopentrader,代码行数:14,代码来源:RealTimeTickChart.java
示例7: getChartOptions
import com.googlecode.wickedcharts.highcharts.options.series.Point; //导入依赖的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
示例8: getChartOptionsDifferently
import com.googlecode.wickedcharts.highcharts.options.series.Point; //导入依赖的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
示例9: HomePage
import com.googlecode.wickedcharts.highcharts.options.series.Point; //导入依赖的package包/类
public HomePage(final PageParameters parameters) {
super(parameters, "Home", PageType.HOME);
// create the players analyzed chart on the landing page
Options playerOptions = new Options();
playerOptions.setTooltip(new Tooltip());
playerOptions.setTitle(new Title("Players analyzed"));
// make chart a pie chart with a height of 800
playerOptions.setChartOptions(new ChartOptions().setType(SeriesType.PIE).setHeight(800));
// disable shadows for the chart
playerOptions.setPlotOptions(new PlotOptionsChoice().setPie(new PlotOptions().setShadow(false)));
// create data points for regions
PointSeries regionSeries = new PointSeries();
// iterate over all summoner counts and create points accordingly
// then add all points to the series
PageDataProvider.overallSummonerStatisticItem.getSummonerCounts().entrySet().stream()
.map(e -> new Point(e.getKey(), e.getValue()).setId(e.getKey())).forEach(regionSeries::addPoint);
// set title and size of pie chart
regionSeries.setName("Players");
regionSeries.setSize(new PixelOrPercent(80, PixelOrPercent.Unit.PERCENT));
// position labels and disable their shadows
regionSeries.setDataLabels(new DataLabels().setDistance(-30).setShadow(false));
// add series to chart
playerOptions.addSeries(regionSeries);
// create data points for tiers
PointSeries tierSeries = new PointSeries();
// iterate over all tier counts and create points accordingly
PageDataProvider.overallSummonerStatisticItem.getTierCounts().entrySet().stream()
// iterate over all regions and get their tier counts in on stream
.flatMap(e -> e.getValue().entrySet().stream()
// sort points by tier name within a region
.sorted((e1, e2) -> TierComparator.staticCompare(e1.getKey(), e2.getKey()))
// create a point stream using [region name]-[tier name] as labels and the player counts as values
.map(i -> {
Point point = new Point(e.getKey() + "-" + RankedTier.getTierByName(i.getKey()).name(),
i.getValue(), RankedTier.getTierByName(i.getKey()).getColor());
// use region color for label texts
point.setDataLabels(new DataLabels().setShadow(false).setFormatter(new Function(
"return '<span style=\"color:' + this.series.chart.get('" + e.getKey() +
"').color + '\">' + this.point.name + '</span>'")));
return point;
}))
// add all points to the series
.forEach(tierSeries::addPoint);
// set title size of donut chart
tierSeries.setName("Players");
tierSeries.setInnerSize(new PixelOrPercent(80, PixelOrPercent.Unit.PERCENT));
tierSeries.setSize(new PixelOrPercent(100, PixelOrPercent.Unit.PERCENT));
// disable label shadows
/* tierSeries.setDataLabels(new DataLabels().setShadow(false).setFormatter(new Function(
"return '<span style=\"color:' + this.chart.get('').color + '\">' + this.point.name + '</span>"))); */
// add series to chart
playerOptions.addSeries(tierSeries);
// add the chart to the page
add(new Chart("player_chart", playerOptions));
// set player count in text
add(new Label("player_count", NumberFormatter.formatLong(PageDataProvider.overallSummonerStatisticItem
.getSummonerCounts().values().stream().mapToInt(i -> i).sum())));
// set update time to the time in the users timezone and show the timezone used
// set default timezone
DateTimeZone dateTimeZone = DateTimeZone.UTC;
// try to get the browsers timezone
try {
TimeZone timeZone = ((WebClientInfo) getSession().getClientInfo()).getProperties().getTimeZone();
if (timeZone != null) dateTimeZone = DateTimeZone.forTimeZone(timeZone);
else log.info("timeZone is null");
} catch (Exception ignored) {
// if anything goes wrong, just stick with UTC as default time zone
}
DateTime timeZoneDateTime = new DateTime(MasteryApplication.UPDATE_TIME.toDateTimeToday(), dateTimeZone);
add(new Label("update_time", String.format("%02d:%02d (%s)", timeZoneDateTime.getHourOfDay(), timeZoneDateTime.
getMinuteOfHour(), TimeZone.getTimeZone(dateTimeZone.getID()).getDisplayName(Locale.US))));
}
开发者ID:LogicalOverflow,项目名称:MasterStats,代码行数:82,代码来源:HomePage.java
示例10: ProjectOptions
import com.googlecode.wickedcharts.highcharts.options.series.Point; //导入依赖的package包/类
public ProjectOptions(Project project) {
ChartOptions chartOptions = new ChartOptions()
.setPolar(Boolean.TRUE)
.setType(SeriesType.LINE);
setChartOptions(chartOptions);
setTitle(new Title(project.getName()));
setPane(new Pane().setSize(new PixelOrPercent(90, PixelOrPercent.Unit.PERCENT)));
setLegend(new Legend(false));
setCredits(new CreditOptions().setEnabled(false));
setExporting(new ExportingOptions().setEnabled(false));
List<String> categories = new ArrayList<>();
categories.add(project.getOpportunity().getName());
categories.add(project.getStakeholders().getName());
categories.add(project.getRequirements().getName());
categories.add(project.getSoftwareSystem().getName());
categories.add(project.getWork().getName());
categories.add(project.getTeam().getName());
categories.add(project.getWayOfWorking().getName());
List<Point> points = new ArrayList<>();
points.add(new Point(project.getOpportunityStatus(), project.getAlphaStateWeight(project.getOpportunity())));
points.add(new Point(project.getStakeholdersStatus(), project.getAlphaStateWeight(project.getStakeholders())));
points.add(new Point(project.getRequirementsStatus(), project.getAlphaStateWeight(project.getRequirements())));
points.add(new Point(project.getSoftwareSystemStatus(), project.getAlphaStateWeight(project.getSoftwareSystem())));
points.add(new Point(project.getWorkStatus(), project.getAlphaStateWeight(project.getWork())));
points.add(new Point(project.getTeamStatus(), project.getAlphaStateWeight(project.getTeam())));
points.add(new Point(project.getWayOfWorkingStatus(), project.getAlphaStateWeight(project.getWayOfWorking())));
setxAxis(new Axis()
.setCategories(categories)
.setTickmarkPlacement(TickmarkPlacement.ON)
.setLineWidth(0));
setyAxis(new Axis()
.setMin(0)
.setMax(6)
.setTickInterval(1.0F)
.setLineWidth(0)
.setGridLineInterpolation(GridlineInterpolation.POLYGON));
setTooltip(new Tooltip().setFormatter(new Function().setFunction("return this.point.name;")));
addSeries(new PointSeries()
.setData(points)
.setPointPlacement(PointPlacement.ON)
.setType(SeriesType.AREA)
.setName("Alphas"));
}
开发者ID:bibryam,项目名称:semat,代码行数:52,代码来源:ProjectOptions.java
示例11: GraficoTortaClientes
import com.googlecode.wickedcharts.highcharts.options.series.Point; //导入依赖的package包/类
public GraficoTortaClientes(Map<Cliente, AtomicInteger> a){
setChartOptions(new ChartOptions()
.setPlotBackgroundColor(new NullColor())
.setPlotBorderWidth(null)
.setPlotShadow(Boolean.FALSE));
setTitle(new Title("Grafico Tarjetas por Cliente"));
//*********************************************************************************
PercentageFormatter formatter = new PercentageFormatter();
setTooltip(
new Tooltip()
.setFormatter(
formatter)
. setPercentageDecimals(1));
//*********************************************************************************
setPlotOptions(new PlotOptionsChoice()
.setPie(new PlotOptions()
.setAllowPointSelect(Boolean.TRUE)
.setCursor(Cursor.POINTER)
.setDataLabels(new DataLabels()
.setEnabled(Boolean.TRUE)
.setColor(new HexColor("#000000"))
.setConnectorColor(new HexColor("#000000"))
.setFormatter(formatter))));
//*********************************************************************************
Series<Point> series = new PointSeries()
.setType(SeriesType.PIE);
series.setTooltip(
new Tooltip().setFormatter(new Function().setFunction(" return ''+ Pepe +': '+ Juan;")));
//*********************************************************************************
int i=0;
for (Map.Entry<Cliente, AtomicInteger> entry : a.entrySet()) {
series
.addPoint(
//*********************************************************************************
new Point(entry.getKey().getNombre(), entry.getValue().get()).setColor(
new RadialGradient()
.setCx(0.5)
.setCy(0.3)
.setR(0.7)
.addStop(0, new HighchartsColor(i))
.addStop(1, new HighchartsColor(i).brighten(-0.3f))));
//*********************************************************************************
i++;
}
addSeries(series);
}
开发者ID:TesisTarjetasMejorar,项目名称:TarjetasISIS,代码行数:48,代码来源:GraficoTortaClientes.java
示例12: GraficoTortaReportadas
import com.googlecode.wickedcharts.highcharts.options.series.Point; //导入依赖的package包/类
public GraficoTortaReportadas(Map<Boolean, AtomicInteger> a){
setChartOptions(new ChartOptions()
.setPlotBackgroundColor(new NullColor())
.setPlotBorderWidth(null)
.setPlotShadow(Boolean.FALSE));
setTitle(new Title("Grafico Tarjetas Reportadas"));
PercentageFormatter formatter = new PercentageFormatter();
setTooltip(
new Tooltip()
.setFormatter(
formatter)
. setPercentageDecimals(1));
setPlotOptions(new PlotOptionsChoice()
.setPie(new PlotOptions()
.setAllowPointSelect(Boolean.TRUE)
.setCursor(Cursor.POINTER)
.setDataLabels(new DataLabels()
.setEnabled(Boolean.TRUE)
.setColor(new HexColor("#000000"))
.setConnectorColor(new HexColor("#000000"))
.setFormatter(formatter))));
Series<Point> series = new PointSeries()
.setType(SeriesType.PIE);
int i=0;
for (Map.Entry<Boolean, AtomicInteger> entry : a.entrySet()) {
series
.addPoint(
new Point(nombre(entry.getKey()), entry.getValue().get()).setColor(
new RadialGradient()
.setCx(0.5)
.setCy(0.3)
.setR(0.7)
.addStop(0, new HighchartsColor(i))
.addStop(1, new HighchartsColor(i).brighten(-0.3f))));
i++;
}
addSeries(series);
}
开发者ID:TesisTarjetasMejorar,项目名称:TarjetasISIS,代码行数:43,代码来源:GraficoTortaReportadas.java
示例13: GraficoTortaEventos
import com.googlecode.wickedcharts.highcharts.options.series.Point; //导入依赖的package包/类
public GraficoTortaEventos(Map<Evento, AtomicInteger> a){
setChartOptions(new ChartOptions()
.setPlotBackgroundColor(new NullColor())
.setPlotBorderWidth(null)
.setPlotShadow(Boolean.FALSE));
setTitle(new Title("Grafico Tarjetas por Eventos"));
PercentageFormatter formatter = new PercentageFormatter();
setTooltip(
new Tooltip()
.setFormatter(
formatter)
. setPercentageDecimals(1));
setPlotOptions(new PlotOptionsChoice()
.setPie(new PlotOptions()
.setAllowPointSelect(Boolean.TRUE)
.setCursor(Cursor.POINTER)
.setDataLabels(new DataLabels()
.setEnabled(Boolean.TRUE)
.setColor(new HexColor("#000000"))
.setConnectorColor(new HexColor("#000000"))
.setFormatter(formatter))));
Series<Point> series = new PointSeries()
.setType(SeriesType.PIE);
int i=0;
for (Map.Entry<Evento, AtomicInteger> entry : a.entrySet()) {
series
.addPoint(
new Point(entry.getKey().getNombre(), entry.getValue().get()).setColor(
new RadialGradient()
.setCx(0.5)
.setCy(0.3)
.setR(0.7)
.addStop(0, new HighchartsColor(i))
.addStop(1, new HighchartsColor(i).brighten(-0.3f))));
i++;
}
addSeries(series);
}
开发者ID:TesisTarjetasMejorar,项目名称:TarjetasISIS,代码行数:43,代码来源:GraficoTortaEventos.java
示例14: GraficoTortaBarras
import com.googlecode.wickedcharts.highcharts.options.series.Point; //导入依赖的package包/类
public GraficoTortaBarras(Map<String, AtomicInteger> a){
setChartOptions(new ChartOptions()
.setPlotBackgroundColor(new NullColor())
.setPlotBorderWidth(null)
.setPlotShadow(Boolean.FALSE));
setTitle(new Title("Grafico Tarjetas por Cliente"));
setSubtitle(new Title("Los meses que no aparecen, es por que no se registran cargas de tarjetas"));
PercentageFormatter formatter = new PercentageFormatter();
setTooltip(
new Tooltip()
.setFormatter(
formatter)
. setPercentageDecimals(1));
setPlotOptions(new PlotOptionsChoice()
.setPie(new PlotOptions()
.setAllowPointSelect(Boolean.TRUE)
.setCursor(Cursor.POINTER)
.setDataLabels(new DataLabels()
.setEnabled(Boolean.TRUE)
.setColor(new HexColor("#000000"))
.setConnectorColor(new HexColor("#000000"))
.setFormatter(formatter))));
//*********************************************************************************
Series<Point> series = new PointSeries()
.setType(SeriesType.COLUMN);
List<String> titles = new ArrayList<String>();
//*********************************************************************************
int i=0;
for (Map.Entry<String, AtomicInteger> entry : a.entrySet()) {
series
.addPoint(
new Point(entry.getKey(), entry.getValue().get()).setColor(
new RadialGradient()
.setCx(0.5)
.setCy(0.3)
.setR(0.7)
.addStop(0, new HighchartsColor(i))
.addStop(1, new HighchartsColor(i).brighten(-0.3f))));
titles.add(""+entry.getKey());
i++;
}
this.setxAxis(new Axis().setCategories(titles));
//*********************************************************************************
addSeries(series);
}
开发者ID:TesisTarjetasMejorar,项目名称:TarjetasISIS,代码行数:60,代码来源:GraficoTortaBarras.java
示例15: GraficoTortaResueltos
import com.googlecode.wickedcharts.highcharts.options.series.Point; //导入依赖的package包/类
public GraficoTortaResueltos(Map<Boolean, AtomicInteger> a){
setChartOptions(new ChartOptions()
.setPlotBackgroundColor(new NullColor())
.setPlotBorderWidth(null)
.setPlotShadow(Boolean.FALSE));
setTitle(new Title("Grafico Tarjetas Resueltas"));
PercentageFormatter formatter = new PercentageFormatter();
setTooltip(
new Tooltip()
.setFormatter(
formatter)
. setPercentageDecimals(1));
setPlotOptions(new PlotOptionsChoice()
.setPie(new PlotOptions()
.setAllowPointSelect(Boolean.TRUE)
.setCursor(Cursor.POINTER)
.setDataLabels(new DataLabels()
.setEnabled(Boolean.TRUE)
.setColor(new HexColor("#000000"))
.setConnectorColor(new HexColor("#000000"))
.setFormatter(formatter))));
Series<Point> series = new PointSeries()
.setType(SeriesType.PIE);
int i=0;
for (Map.Entry<Boolean, AtomicInteger> entry : a.entrySet()) {
series
.addPoint(
new Point(nombre(entry.getKey()), entry.getValue().get()).setColor(
new RadialGradient()
.setCx(0.5)
.setCy(0.3)
.setR(0.7)
.addStop(0, new HighchartsColor(i))
.addStop(1, new HighchartsColor(i).brighten(-0.3f))));
i++;
}
addSeries(series);
}
开发者ID:TesisTarjetasMejorar,项目名称:TarjetasISIS,代码行数:43,代码来源:GraficoTortaResueltos.java
示例16: RealTimeTickChart
import com.googlecode.wickedcharts.highcharts.options.series.Point; //导入依赖的package包/类
public RealTimeTickChart(String name, final String symbol, int tickCount,
int refresh) {
super(name, new Options());
this.setSymbol(symbol);
final TickPriceDAO tpd = new TickPriceDAO();
// Real time chart
Options options = new Options();
options.setyAxis(new Axis().setTitle(new Title("Value")));
options.setTitle(new Title("Last " + tickCount + " ticks for " + symbol));
options.setxAxis(new Axis().setType(AxisType.DATETIME)
.setTickPixelInterval(250));
options.setExporting(new ExportingOptions().setEnabled(Boolean.FALSE));
// Live data series for Ask price
// CustomCoordinatesSeries<String, Number> serie = new
// CustomCoordinatesSeries<>();
LiveDataSeries askSeries = new LiveDataSeries(options, refresh) {
@Override
public Point update(LiveDataUpdateEvent event) {
// TODO Auto-generated method stub
Point point = new Point();
// point.setX(new java.util.Date().getTime());
Tick tick = tpd.getLastPriceForSymbolAsObject(symbol, "LAST");
point.setY(tick.getPrice());
point.setX(tick.getTimestamp().getTime());
return point;
}
};
Tick[] listOfTicks = tpd.getTicksForSymbol(symbol, "LAST", tickCount);
askSeries.setData(randomData(listOfTicks.length, symbol, listOfTicks));
askSeries.setName("Price");
options.addSeries(askSeries);
super.setOptions(options);
}
开发者ID:sgrotz,项目名称:myopentrader,代码行数:47,代码来源:RealTimeTickChart.java
示例17: getOptionsForHistoricalChart
import com.googlecode.wickedcharts.highcharts.options.series.Point; //导入依赖的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
示例18: getChartOptions
import com.googlecode.wickedcharts.highcharts.options.series.Point; //导入依赖的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
示例19: getChartOptionsDifferently
import com.googlecode.wickedcharts.highcharts.options.series.Point; //导入依赖的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
示例20: setSelectedPoint
import com.googlecode.wickedcharts.highcharts.options.series.Point; //导入依赖的package包/类
public void setSelectedPoint(final Point selectedPoint) {
this.selectedPoint = selectedPoint;
}
开发者ID:PkayJava,项目名称:pluggable,代码行数:4,代码来源:InteractionEvent.java
注:本文中的com.googlecode.wickedcharts.highcharts.options.series.Point类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论