how to add unknow numbers of colors to this array ? for example i whant to add 6 colors
int[] colors = new int[] { Color.RED, Color.YELLOW, Color.BLUE,Color.GREEN };
and how to add unknow numbers of categorySeries ? for example i want to add 6 categorySeries
CategorySeries categorySeries = new CategorySeries("Vehicles Chart");
categorySeries.add("cars ", 30);
categorySeries.add("trucks", 20);
categorySeries.add("bikes ", 60);
categorySeries.add("plan ", 40);
thanks in advance
You can’t add unknown numbers of items to an array, because arrays can’t resize.
Use an
ArrayListinstead:And for the colors: