Hello, I just downloaded JFreeChart 0.9.21 for my JDK 1.3 on Solaris. I create a line chart from a query that returns thousands of rows. But there are no labels whatsoever marking points along the x-axis. How can I set up just a few labels to appear? Here is my code:
JDBCCategoryDataset lineDataSet = null;
Connection con;
try {
con = DBDaemon.getConnection(sPool);
lineDataSet = new JDBCCategoryDataset(con);
lineDataSet.executeQuery(sQuery);
con.close();
}
catch (SQLException e) {
System.err.print("SQLException: ");
System.err.println(e.getMessage());
throw new RuntimeException(e.getMessage());
}
catch (Exception e) {
System.err.print("Exception: ");
System.err.println(e.getMessage());
throw new RuntimeException(e.getMessage());
}
JFreeChart chart = ChartFactory.createLineChart
(sTitle, // Title
sDomainLabel, // Domain access label
sRangeLabel, // Range access label
lineDataSet, // Dataset
PlotOrientation.VERTICAL, // Plot Orientation
true, //legend
true, // tooltips
false
);
How can I customize the x-axis of line charts?
-
- Posts: 3
- Joined: Wed Nov 03, 2004 8:28 pm
-
- Posts: 3
- Joined: Wed Nov 03, 2004 8:28 pm
I am using JDBCCategoryDataset. This is the complete fragment.
JDBCCategoryDataset lineDataSet = null;
Connection con;
try {
con = DBDaemon.getConnection(sPool);
lineDataSet = new JDBCCategoryDataset(con);
lineDataSet.executeQuery(sQuery);
con.close();
}
catch (SQLException e) {
System.err.print("SQLException: ");
System.err.println(e.getMessage());
throw new RuntimeException(e.getMessage());
}
catch (Exception e) {
System.err.print("Exception: ");
System.err.println(e.getMessage());
throw new RuntimeException(e.getMessage());
}
chart = ChartFactory.createLineChart
(sTitle, // Title
sDomainLabel, // Domain access label
sRangeLabel, // Range access label
lineDataSet, // Dataset
PlotOrientation.VERTICAL, // Plot Orientation
true, //legend
true, // tooltips
false
);
JDBCCategoryDataset lineDataSet = null;
Connection con;
try {
con = DBDaemon.getConnection(sPool);
lineDataSet = new JDBCCategoryDataset(con);
lineDataSet.executeQuery(sQuery);
con.close();
}
catch (SQLException e) {
System.err.print("SQLException: ");
System.err.println(e.getMessage());
throw new RuntimeException(e.getMessage());
}
catch (Exception e) {
System.err.print("Exception: ");
System.err.println(e.getMessage());
throw new RuntimeException(e.getMessage());
}
chart = ChartFactory.createLineChart
(sTitle, // Title
sDomainLabel, // Domain access label
sRangeLabel, // Range access label
lineDataSet, // Dataset
PlotOrientation.VERTICAL, // Plot Orientation
true, //legend
true, // tooltips
false
);