user3029929
user3029929

Reputation: 491

How to show Multiple data series in jfree chart

I want to add multiple datasets in one row. How we can do this with Jfree chart? so that my output comes with multiple color codes in single row of BAR graph

public class Demo {

public static void main(String arg[]){      

    DefaultCategoryDataset dataset = new DefaultCategoryDataset();

    dataset.setValue(2, "Amu-referet Form", "Dtest");
      dataset.setValue(7, "ApraisalForm", "Richa Dept");
      dataset.setValue(4, "Feedback", "Test department");
      dataset.setValue(12, "HES report", "Vipul HR dept");
      dataset.setValue(6, "Marks", "Chandan");


    JFreeChart chart = ChartFactory.createBarChart3D("Any title", "x label", "y label", dataset, PlotOrientation.HORIZONTAL, true, true, true);


      ChartFrame frame1=new ChartFrame("Bar Chart",chart);
      frame1.setVisible(true);
      frame1.setSize(400,350);
      }
    }

Upvotes: 2

Views: 1496

Answers (1)

user3029929
user3029929

Reputation: 491

My problem got solved by using ChartFactory.createStackedBarChart3D() method

Upvotes: 1

Related Questions