Hi Dave and all,
I have created all type of charts using jfree.I am really happy to use jfree in chart making for my company project dashboard.And also i am presently going thro the classes,methods defined to change the chart properties according to our requirement.Now i am in need to change the axis values of chart to make it visible and understandable.And also to change the axis fonts,to make dual charts i am in need of ur help my
friends.
I have given the example coding.I want to change axis values within a particular range,and also implementing dual axis for this chart,finally change of font sizes and font colors.
String seriesNames = "Months";
Color bgColor = new Color(205,211,214);
//Line Parameters
String line1="Total No.of Milestones";
String line2="Total Unbilled Amount";
//Row Names
// String[] monthsname=new string[] {"April","May","June","July"};
String month1="Mar,06";
String month2="Apr,06";
String month3="May,06";
String month4="June,06";
// creating Dataset
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
dataset.addValue(1000,line1,month1);
dataset.addValue(800, line1,month2);
dataset.addValue(600, line1,month3);
dataset.addValue(400, line1, month4);
dataset.addValue(85, line2,month1);
dataset.addValue(100, line2,month2);
dataset.addValue(125, line2,month3);
dataset.addValue(110, line2, month4);
//PlotOrientation plot = new PlotOrientation("VERTICAL");
JFreeChart jfc = ChartFactory.createBarChart
("Unbilled Milestones chart", // Title
"No.of.Milestones & Unbilled Amount", // X-Axis label
"Month ", // Y-Axis label
dataset, // Dataset
PlotOrientation.VERTICAL, //Plot
true, // Show legend
true, // Show legend
true
);
jfc.setBackgroundPaint(bgColor);
final CategoryPlot plot = jfc.getCategoryPlot();
//final XYPlot plot = jfc.getXYPlot();
//final LineAndShapeRenderer renderer = (LineAndShapeRenderer) plot.getRenderer();
// renderer.setDrawShapes(true);
ChartUtilities.saveChartAsJPEG(new File("C:/Program Files/Apache Software Foundation/Tomcat 5.0/webapps/board/unbilled_mile_ch7_monthly_chart.jpg"), jfc, 1024, 768);
Awaiting for ur reply..........
regards,
Vairamuthu M
I want to change axis values and also to make dual axis char
-
- Posts: 9
- Joined: Tue Jul 11, 2006 8:10 am
- Location: Delhi
- Contact:
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
It isn't clear to me what you want to change...
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- Posts: 9
- Joined: Tue Jul 11, 2006 8:10 am
- Location: Delhi
- Contact:
Customizing axis values and dual chart customization
Hi Dave and All,
I will clearly explain what i want.
1.Actually i am retrieving date from database based on that chart axis values(or labels) are coming.I want to customize those values and fix it in specific range that range should be well divided or defined and visible one.
That is labels showing on y-axis should be visible to every one and their difference from one point to another point should be fixed by the user.
2.I want to change the axis values(or labels),series name font types,sizes.
3.I want to make dual axis chart in which both primary axis and secondary axis values are to set upon based on the values retrived from the database.for ex if am showing no.0-100(with an interval of 10) in primary axis and in secondary axis the values are 0-100000 (with an interval of 10000).How can i set the range in y-axis.x-axis is based on week or months.
These are the questions arise in my mind when i am working in jfree chart.
Regards,
Vairamuthu M
I will clearly explain what i want.
1.Actually i am retrieving date from database based on that chart axis values(or labels) are coming.I want to customize those values and fix it in specific range that range should be well divided or defined and visible one.
That is labels showing on y-axis should be visible to every one and their difference from one point to another point should be fixed by the user.
2.I want to change the axis values(or labels),series name font types,sizes.
3.I want to make dual axis chart in which both primary axis and secondary axis values are to set upon based on the values retrived from the database.for ex if am showing no.0-100(with an interval of 10) in primary axis and in secondary axis the values are 0-100000 (with an interval of 10000).How can i set the range in y-axis.x-axis is based on week or months.
These are the questions arise in my mind when i am working in jfree chart.
Regards,
Vairamuthu M