Hi,
Could someone please tell me why this piece of code is not drawing vertical bar chart.
I want each bar color to be of different color. Since, each series displays all bars in same color, I am creating individual series for each bar chart. But, it displays line charts instead of bars.
I tried creating bar chart with just one series also, but it displayed line chart for that also.
public JFreeChart createBarChart( DataSet dataSet )
{
// create a dataset...
double[][] data = new double[][] {
{ 1.0, 0.0, 0.0},
{ 0.0, 7.0, 0.0 },
{ 0.0, 0.0, 2.0 }
};
DefaultCategoryDataset dataCat = new DefaultCategoryDataset(data);
// set the category names...
String[] categories = new String[] { "A", "B", "C };
dataCat .setCategories(categories);
//create chart with xAxisTitle, yAxis Title. No legend
return ChartFactory.createVerticalBarChart( "", "xAxisTitle" , "yAxisTitle", dataCat ,false );
}
Vertical Bar Chart Issues
Re: Vertical Bar Chart Issues
please ignore this. I found out the problem. It was picking
LineAndShapeRenderer instead of VerticalBarRenderer.
LineAndShapeRenderer instead of VerticalBarRenderer.