Why can't I copy a value from one XYSeriesCollection to other?
问题 I'm using JFreeChart to create an image histogram in java swing. In order to create it I iterate over all pixels to get all the colors. Depending on the size and bit depth it takes some time. Once I have all the data I put it into a XYSeriesCollection variable. To be able to show and hide some series latter I save a copy of that variable. My problem is that if I do it like this: final XYSeriesCollection data = createHistogram(); final XYSeriesCollection dataCopy = createHistogram(); It works