title: JavaFX CSS WARNING: CSS Error parsing file : ... : Expected LBRACE at
body: <p>I recently ask a question about adding two vertical lines onto the JavaFX LineChart and now I am having issue with applying some style stuffs to the plots. I think this is a new question so I open a new thread.</p>
  
  <p><a href="https://stackoverflow.com/questions/28952133/how-to-add-two-vertical-lines-with-javafx-linechart">Add Two Vertical Lines to LineChart</a></p>
  
  <p>My question: How can I change different color of the series? I also want to change the background to be white.</p>
  
  <p>The following is the chart that I create (it extends LineChart):</p>
  
  <pre><code>LineChartWithMarkers&lt;Number, Number&gt; chart = new LineChartWithMarkers&lt;Number, Number&gt;(xAxis, yAxis, dataset);
  
  xAxis.setLabel("time(s)");
  yAxis.setLabel("deg/s");
  
  chart.setStyle(".chart-series-line { -fx-stroke-width: 2px; -fx-effect: null; ");
  chart.setStyle(".default-color0.chart-series-line { -fx-stroke: blue; }");
  chart.setStyle(".default-color1.chart-series-line { -fx-stroke: red; }");
  chart.setStyle(".default-color0.chart-line-symbol { -fx-stroke: blue, blue; }");
  chart.setStyle(".default-color1.chart-line-symbol { -fx-stroke: red, red; }");
  chart.setStyle(".chart-legend { -fx-background-color: transparent; }");
  </code></pre>
  
  <p>For some reason, those codes won't apply to the chart. So I try to use a CSS file.</p>
  
  <p>The following is the CSS file:</p>
  
  <pre><code>@CHARSET "ISO-8859-1";
  
  .chart-series-line {
  -fx-stroke-width: 1px;
  -fx-effect: null;}
  
  .default-color0.chart-series-line { -fx-stroke: blue; }
  .default-color1.chart-series-line { -fx-stroke: red; }
  
  .default-color0.chart-line-symbol { -fx-background-color: blue, blue; }
  .default-color1.chart-line-symbol { -fx-background-color: red, red; }
  
  .chart-legend {
  -fx-background-color: transparent;
  -fx-font-size: 0.75em;}
  
  .chart-legend-item-symbol{
  -fx-background-radius: 2;}
  
  .chart-plot-background {
  -fx-background-color: transparent;}
  </code></pre>
  
  <p>I try to follow <a href="http://docs.oracle.com/javafx/2/charts/css-styles.htm" rel="nofollow noreferrer">Using JavaFX Charts: Styling Charts with CSS</a>, but I get an error in the console is "WARNING: CSS Error parsing file : ... : Expected LBRACE at [1,9]"</p>
  
  <p>I just switch from JDK 7 to JDK 8 today so I am not sure if it has anything to do with that...</p>
  
  <p>Thanks for any help!</p>