Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8102308

Add @DefaultProperty annotation to chart classes

XMLWordPrintable

      For example, annotate XYChart and XYChart.Series with @DefaultProperty("data"). This would significantly reduce the verbosity of the FXML markup required to create a chart. For example, this:

          <BarChart>
              <xAxis><CategoryAxis label="Country"/></xAxis>
              <yAxis><NumberAxis label="Value"/></yAxis>
              
              <data>
                  <FXCollections fx:factory="observableArrayList">
                      <XYChart.Series name="2003">
                          <data>
                              <FXCollections fx:factory="observableArrayList">
                                  <XYChart.Data xValue="$austria" yValue="25601.34"/>
                                  <XYChart.Data xValue="brazil" yValue="20148.82"/>
                                  ...

      would become this:

          <BarChart>
              <xAxis><CategoryAxis label="Country"/></xAxis>
              <yAxis><NumberAxis label="Value"/></yAxis>
              
              <XYChart.Series name="2003">
                  <XYChart.Data xValue="$austria" yValue="25601.34"/>
                  <XYChart.Data xValue="brazil" yValue="20148.82"/>
                  ...

            psomashe Parvathi Somashekar (Inactive)
            gkbrown Greg Brown (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: