title: Is it possible to change the x- and y-axis caption dynamically with the vaadin addon InvientCharts
body: <p>I am using vaadin and for some visual data analysis I've added the addon InvientCharts for vaadin (https://vaadin.com/directory#addon/invient-charts).</p>
  
  <p><strong>Is it possible to dynamically change the x- and y-axis Caption of the scattertchart (so after the chart has been created)?</strong></p>
  
  <p>I'm currently having a scatterchart and a button. When the button is clicked, all existing points (Series) shall be removed, the x- and y-axis caption shall change and the new points shall be added on the chart.</p>
  
  <p>That's the code snippet with which I'm trying it currently:</p>
  
  <pre><code>public void changePoints(String xAxisTitle, String yAxisTitle, List&lt;List&lt;double[]&gt;&gt; xAndYCoordinates) {
          // remove all points from the scatterchart - THIS IS WORKING
          Object[] allSeries = chart.getAllSeries().toArray();
          for(int j = 0; j &lt; allSeries.length; j++){
              Series serie = (Series) allSeries[j];
              chart.removeSeries(serie);
          }
  
          // update the x- and y-axis - THIS IS NOT WORKING AND WHAT I'M TALKING ABOUT
          chartConfig.getXAxes().clear();
          chartConfig.getYAxes().clear();
          NumberXAxis xAxis = new NumberXAxis();
          xAxis.setTitle(new AxisTitle(xAxisTitle));
          xAxis.setStartOnTick(true);
          xAxis.setEndOnTick(true);
          xAxis.setShowLastLabel(true);
          LinkedHashSet&lt;XAxis&gt; xAxesSet = new LinkedHashSet&lt;InvientChartsConfig.XAxis&gt;();
          xAxesSet.add(xAxis);
          chartConfig.setXAxes(xAxesSet);
          NumberYAxis yAxis = new NumberYAxis();
          yAxis.setTitle(new AxisTitle(yAxisTitle));
          LinkedHashSet&lt;YAxis&gt; yAxesSet = new LinkedHashSet&lt;InvientChartsConfig.YAxis&gt;();
          yAxesSet.add(yAxis);
          chartConfig.setYAxes(yAxesSet);
  
  
          // add the new points - THIS IS WORKING AGAIN
          for (int i = 0; i &lt; versionDates.size(); i++) {
              String versionDate = versionDates.get(i);
              List&lt;double[]&gt; versionValues = xAndYCoordinates.get(i);
  
              ScatterConfig versionScatterConfig = new ScatterConfig();
              XYSeries series = new XYSeries("Version " + (i + 1) + " - "
                      + versionDate, versionScatterConfig);
              series.setSeriesPoints(getPoints(series, versionValues));
              chart.addSeries(series);
          }
      }
  </code></pre>
  
  <p>As you can see, the removing and adding of points works perfectly fine, which I assume is because I'm working directly on the chart here, while I'm working on the chartConfig when I try to change the axes caption.</p>
  
  <p>Could you please tell or show me how I can change the caption of the x- and y-Axis in an already existing chart (As described above)?</p>
  
  <p>Thanks a lot </p>