0

i wanna create a line chart from my database that shows the sales in monthly wise. can i make it using a vector like this?? i'm so new to java

    DefaultCategoryDataset dataset = new DefaultCategoryDataset();

    Vector v = new Vector();
    v.add("60");
    v.add("values");
    v.add("student1");


    dataset.addValue(v);



    JFreeChart chart = ChartFactory.createLineChart("parameter values", "parameter", "values", dataset, PlotOrientation.VERTICAL, false, true, false);
     CategoryPlot p = chart.getCategoryPlot();
       p.setRangeGridlinePaint(Color.black);
Door D Uthpala
  • 59
  • 1
  • 11
  • Why not start with the examples cited [here](http://stackoverflow.com/tags/jfreechart/info) and seen [here](http://stackoverflow.com/search?tab=votes&q=%5bjfreechart%5d%20ChartFactory.createLineChart%20DefaultCategoryDataset)? – trashgod May 05 '15 at 09:47
  • Why use [`Vector`](http://stackoverflow.com/q/1386275/261156) at all? – Catalina Island May 05 '15 at 13:02
  • @CatalinaIsland i get my data from a mysql table... :) i figured anyway i use a for loop and use my vector DefaultCategoryDataset dataset object :) – Door D Uthpala May 06 '15 at 06:36
  • 1
    Why not `JDBCCategoryDataset` like [this](http://stackoverflow.com/a/26942183/261156)? – Catalina Island May 06 '15 at 11:46

0 Answers0