FX 2在折线图中设置填充

时间:2012-07-11 18:33:05

标签: charts javafx-2

我有一个XY线图和css文件,我在其中设置图表功能。

我无法弄清楚如何避开图表中的白色边框

enter image description here

我的css设置是:

.chart-plot-background{
-fx-padding:0px;
-fx-font-family: Verdana;
-fx-background-color: linear-gradient(to bottom right, lightsteelblue, black);
}
.chart-content{
-fx-background-color: linear-gradient(to bottom right, lightsteelblue, black);
-fx-padding:30px;
}

我想用相同的颜色填充框架,没有白色边框。

由于

1 个答案:

答案 0 :(得分:0)

我找到了一个解决方案:看起来这些白线充当“边框”,所以我在css文件中添加了这些说明:

-fx-border-color: linear-gradient(to bottom right, lightsteelblue, black);
-fx-border-width: 5;
-fx-border-insets: -5;

不确定这是否是最佳解决方案,任何建议都值得赞赏。