JavaFX AreaChart Clear Data

2,132

I fixed the problem by myself. You can do something like this:

areachart.getData().removeAll(m_histogram.getData());

It will remove all kind of data inside the area chart!!

Share:
2,132

Related videos on Youtube

Lukas Hieronimus Adler
Author by

Lukas Hieronimus Adler

Updated on November 27, 2022

Comments

  • Lukas Hieronimus Adler
    Lukas Hieronimus Adler over 1 year

    i create a Object of a extended Area Chart. In this Area Chart is a dataSerie if the object is created. Later i will add 3 New Data Series to the Area Chart and the first dataSerie musst be deleted.

    How can i delete the first dataSerie?

    areachart.getData().addAll(s1, s2, s3);
    

    Here you can see how i add the new Series into the areachart, but first i want to delete the old ones...

    Thanks for your help


    So now I know it! I can use the following Statement:

    areachart.getData.remove(....)
    

    But this makes another Question open! How can i get the total added Series of the Area Chart. How can I get the information of how many series in the Area Chart are?

    • Lokesh
      Lokesh over 7 years
      Someone please answer it.
  • James_D
    James_D over 9 years
    getData() returns an ObservableList of Series, so you can call any method defined in ObservableList or in List, such as clear(), size(), etc
  • Lokesh
    Lokesh over 7 years
    Its already enabled.
  • Lokesh
    Lokesh over 7 years
    And I have 8.8.8.8 in my resolv.conf. Should it be something else, if yes then how should I determine what it should be?
  • ebal
    ebal over 7 years
    @Lokesh ok, can you disable it (proxy_dns) and try without it
  • Lokesh
    Lokesh over 7 years
    I tried that too. It didn't work out.