Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Set color of graphs in Line Chart

 
Dani Deliani
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need help with setting colors blue, brown, yellow for 3 different graphs in a Line Chart. I have this perfectly working code, but with default colors:



I tried to set the colors with css but Netbeans can't find the css:



How can I get this to work? I'm using Java FXML Application. Thanks for your help.
 
Dani Deliani
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
*******   SOLVED  with below  *********


In css:


.default-color0.chart-series-line { -fx-stroke: blue; }
.default-color1.chart-series-line { -fx-stroke: yellow; }
.default-color2.chart-series-line { -fx-stroke: brown; }

Remeber to put your css file in the src folder and then add this code in the JavaFXApplication.java



This is my code for creating the Line Chart:



That's it.
 
Rob Spoor
Sheriff
Pie
Posts: 20751
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for sharing your solution
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic