[英]Is it possible to change the Values of a NumberAxis in JavaFX 2.0?
[英]Javafx chart change NumberAxis to CategoryAxis
我已經創建了一個AreaChart
與SceneBuilder NumberAxis
上的X軸和NumberAxis
在Y軸上。
@FXML
private AreaChart<Number,Number> areaChart;
和FXML:
<AreaChart fx:id="areaChart" alternativeColumnFillVisible="true" createSymbols="false" style="-fx-horizontal-grid-lines-color: white;" title="Altura durante la sesión">
<xAxis>
<NumberAxis fx:id="areaX" animated="false" label="Distancia (metros)" style="axis_color: white;" />
</xAxis>
<yAxis>
<NumberAxis fx:id="areaY" label="Altura (metros)" style="axis_color: white;" />
</yAxis>
我想通過按一個按鈕將該AreaChart轉換為一個AreaChart
,在Y軸上使用NumberAxis
,在X軸上使用CategoryAxis
。 因為我必須制作一個Heigth x Distance圖表,然后按一個按鈕將該圖表轉換為Height x Time圖表,並且按下按鈕后的結果必須是:
<AreaChart fx:id="areaChart" alternativeColumnFillVisible="true" createSymbols="false" style="-fx-horizontal-grid-lines-color: white;" title="Altura durante la sesión">
<xAxis>
<CategoryAxis fx:id="areaX" animated="false" label="Distancia (metros)" style="axis_color: white;" />
</xAxis>
<yAxis>
<NumberAxis fx:id="areaY" label="Altura (metros)" style="axis_color: white;" />
</yAxis>
我認為更改嘗試更改圖表的軸類型不是一個好主意(我什至不確定是否可以這樣做)。
相反,我建議:
這樣可以使您根據需要顯示具有適當軸類型的適當圖表。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.