use of javafx.scene.chart.XYChart.Series in project Gargoyle by callakrsos.
the class ScmCommitComposite method load.
public void load() {
try {
scmHistoryWalk();
getBarChartDayOfMonthCategory().setLabel("기간별 커밋 통계");
getLineChartDayOfWeekCategory().setLabel("요일별 커밋 통계");
getBarChartDayOfMonthCategory().getCategories().add(SERIES_LABEL);
getLineChartDayOfWeekCategory().getCategories().add(SERIES_LABEL);
Color lineColor = Color.GREEN;
double strokeWidth = 1;
String cssStyleClassName = ".chart-series-line";
{
/*start Desing css.*/
BarChart<String, Long> barChartDayOfMonth = getBarChartDayOfMonth();
String style = "-fx-bar-fill: ".concat(FxUtil.toWebString(lineColor)).concat(";");
for (Node n : barChartDayOfMonth.lookupAll(".default-color0.chart-bar")) {
n.setStyle(style);
}
// barChartDayOfMonth.setStyle(
// ".chart-legend-item-syCmbol chart-bar series0 bar-legend-symbol default-color0{- fx-background-color:green;}");
/*end Desing css.*/
/*start Popover*/
//무조건 1개의 시리즈만 처리하므로 인덱스에서 바로 가져옴.
ObservableList<Data<String, Long>> dataArr = getBarChartDayOfMonth().getData().get(0).getData();
for (Data<String, Long> d : dataArr) {
d.getNode().setOnMouseClicked(ev -> {
if (ev.getClickCount() == 1 && ev.getButton() == MouseButton.PRIMARY)
createPopOver(d);
});
}
barChartDayOfMonth.setMinWidth(BarChart.USE_COMPUTED_SIZE);
barChartDayOfMonth.requestLayout();
/*end Popover*/
}
{
LineChart<String, Long> lineChartDayOfWeek = getLineChartDayOfWeek();
lineChartDayOfWeek.setStyle(".chart-series-line .series0 .default-color0{- fx-background-color:green;}");
Set<Node> lookupAll = lineChartDayOfWeek.lookupAll(".chart-line-symbol");
StringBuffer sb = new StringBuffer();
sb.append("-fx-background-color: " + FxUtil.toRgbString(lineColor) + ", white;");
sb.append(" -fx-background-insets: 0, 2;");
sb.append("-fx-background-radius: 5px;");
sb.append("-fx-padding: 5px;");
for (Node n : lookupAll) {
n.setStyle(sb.toString());
}
String style = "-fx-stroke: " + FxUtil.toRgbString(lineColor) + "; -fx-stroke-width: " + strokeWidth + ";";
for (Node seriesLine : lineChartDayOfWeek.lookupAll(cssStyleClassName)) {
seriesLine.setStyle(style);
}
}
} catch (SVNException e) {
LOGGER.error(ValueUtil.toString(e));
}
}
use of javafx.scene.chart.XYChart.Series in project Gargoyle by callakrsos.
the class SVNViewer method svnTreeViewOnAction.
public void svnTreeViewOnAction(SVNItem item) {
if (!item.isDir()) {
lastSelectedSVNItem.set(item);
tbRevision.getItems().clear();
LineChart<String, String> lineHist = new LineChart<>(new CategoryAxis(), new CategoryAxis());
// lineHist.setRotate(90d);
// lineHist.scaleXProperty().set(0.7);
// lineHist.scaleYProperty().set(0.7);
lineHist.autosize();
lineHist.setLegendVisible(false);
List<SVNLogEntry> logs = item.getManager().log(item.getPath());
tbRevision.getItems().addAll(logs.stream().sorted(sortUpper).collect(Collectors.toList()));
// 시리즈 생성
ObservableList<Data<String, String>> observableArrayList = FXCollections.observableArrayList();
logs.stream().sorted(sortLower).forEach(entry -> {
Date date = entry.getDate();
String dateString = DateUtil.getDateString(date.getTime(), "yy-MM-dd HH:mm");
Data<String, String> data = new Data<>(dateString, entry.getAuthor());
setDataNode(entry, data);
data.getNode().setOnMouseClicked(e -> {
if (e.getClickCount() == 2 && e.getButton() == MouseButton.PRIMARY) {
String path = item.path;
long revision = entry.getRevision();
String content = item.getManager().cat(path, String.valueOf(revision));
BorderPane pane = new BorderPane(FxUtil.createJavaTextArea(content));
pane.setTop(new Label(item.getManager().fromPrettySVNLogConverter().apply(entry)));
FxUtil.showPopOver(data.getNode(), pane);
}
});
data.getNode().setOnMouseEntered(ev -> {
data.getNode().setBlendMode(BlendMode.GREEN);
});
data.getNode().setOnMouseExited(ev -> {
data.getNode().setBlendMode(null);
});
observableArrayList.add(data);
});
Series<String, String> series = new Series<>("Commitors.", observableArrayList);
lineHist.getData().add(series);
borChart.setCenter(lineHist);
String cat = item.getManager().cat(item.getPath());
// String simpleName = item.getSimpleName();
javaTextAre.setContent(cat);
tabPaneSVN.getSelectionModel().select(tabHistChart);
}
}
use of javafx.scene.chart.XYChart.Series in project Gargoyle by callakrsos.
the class PMDViolationbyBarChartComposite method createNode.
/* (non-Javadoc)
* @see com.kyj.fx.voeditor.visual.component.pmd.chart.PMDViolationChartVisualable#createNode()
*/
@Override
public Node createNode() {
xAxis = new CategoryAxis();
xAxis.setAutoRanging(false);
xAxis.setAnimated(false);
yAxis = new NumberAxis();
yAxis.setAnimated(false);
yAxis.setPrefWidth(60d);
yAxis.setAutoRanging(true);
yAxis.setMaxWidth(60d);
yAxis.setLabel("Violation Count");
Series<String, Number> dataList = new Series<>(FXCollections.observableArrayList());
dataList.setName("Priority");
BarChart<String, Number> c = new BarChart<>(xAxis, yAxis);
barChart.set(c);
series = c.getData();
series.add(0, dataList);
this.dataList = dataList.getData();
return c;
}
use of javafx.scene.chart.XYChart.Series in project Money-Manager by krHasan.
the class ExpenseChart method getExpenseData.
public static Series<String, Number> getExpenseData(String monthName) {
XYChart.Series<String, Number> sector = new XYChart.Series<>();
String[] allSector = new ComboboxList().getSectorList();
// chart data for all other Sectors
for (String sectorName : allSector) {
String sectorShortName = getAbbreviateName(sectorName);
double amount = longToDouble(new Sector().getAmountBySectorFromExpense(monthName, sectorName));
sector.getData().add(new XYChart.Data<>(sectorShortName, amount));
}
// chart data for "Adjusted Balance" Sector
String srtName = getAbbreviateName("Adjusted Balance");
double amnt = longToDouble(new Sector().getAmountBySectorFromExpense(monthName, "Adjusted Balance"));
sector.getData().add(new XYChart.Data<>(srtName, amnt));
return sector;
}
use of javafx.scene.chart.XYChart.Series in project cryptomator by cryptomator.
the class UnlockedController method startIoSampling.
// ****************************************
// IO Graph
// ****************************************
private void startIoSampling() {
final Series<Number, Number> decryptedBytes = new Series<>();
decryptedBytes.setName(localization.getString("unlocked.label.statsDecrypted"));
final Series<Number, Number> encryptedBytes = new Series<>();
encryptedBytes.setName(localization.getString("unlocked.label.statsEncrypted"));
ioGraph.getData().add(decryptedBytes);
ioGraph.getData().add(encryptedBytes);
ioAnimation = new Timeline();
ioAnimation.getKeyFrames().add(new KeyFrame(Duration.seconds(IO_SAMPLING_INTERVAL), new IoSamplingAnimationHandler(decryptedBytes, encryptedBytes)));
ioAnimation.setCycleCount(Animation.INDEFINITE);
ioAnimation.play();
}
Aggregations