user1631306
user1631306

Reputation: 4470

javafx font size of chart title and axis label

I am using javafx to plot bar chart and pie chart. I need to:

  1. Change the font size of the x-axis label in bar chart
  2. Change the font size of the bar chart title
  3. Change the font size of the pie chart title

For bar chart I am using

xAxis.tickLabelFontProperty().set(Font.font(fontSize));

which only changes the font size of the text(units) on xaxis, but doenst change the x axis label

Similarly I am using

chart.setStyle("-fx-font-size: " + fontSize + "px;");

to change the label of pies in pie chart. It does change the size of the title of pie chart but not in same ratio.

Upvotes: 2

Views: 4227

Answers (1)

user1631306
user1631306

Reputation: 4470

Nevermind I was able to change it using

chart.setStyle("-fx-font-size: " + fontSize + "px;");

but still the title font size doesnt change in expected ratio. But I can work live with it

Upvotes: 2

Related Questions