Reputation: 491
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
Reputation: 491
My problem got solved by using ChartFactory.createStackedBarChart3D() method
Upvotes: 1