Как отображать значение стержня в верхней части бара JavafxJAVA

Программисты JAVA общаются здесь
Anonymous
Как отображать значение стержня в верхней части бара Javafx

Сообщение Anonymous »

from this code i can generate bar chart of 10 bars now i want to know how to display value of each bar on top of bar like the attached image:
Изображение


here is code:

public class BarChartSample extends Application {

@Override public void start(Stage stage) {
stage.setTitle("Bar Chart Sample");
final CategoryAxis xAxis = new CategoryAxis();
final NumberAxis yAxis = new NumberAxis();
final BarChart bc =
new BarChart(xAxis,yAxis);
bc.setTitle("Country Summary");
xAxis.setLabel("bars");
yAxis.setLabel("Value");

XYChart.Series series1 = new XYChart.Series();
series1.setName("...");

for(int i=0;i5 than red if i>8 than blue
series1.getData().add(new XYChart.Data("Value", i));

}

}

public static void main(String[] args) {
launch(args);
}
}


Подробнее здесь: https://stackoverflow.com/questions/152 ... bar-javafx

Вернуться в «JAVA»