need help for bar graph
-
- Posts: 5
- Joined: Thu Oct 25, 2007 4:29 pm
- Location: India
- Contact:
need help for bar graph
hi,
i would be very grateful if someone can guide me how to fix my problem.
i am creating a bar chart with jfreechart which is coming fine except for the base items. i mean the labels at the bottom of each bar.
for a big text like MY_BIG_COMPANY_NAME
it shows MY_BIG_CO...
can i get the full text here.
thanks,
Kapil
i would be very grateful if someone can guide me how to fix my problem.
i am creating a bar chart with jfreechart which is coming fine except for the base items. i mean the labels at the bottom of each bar.
for a big text like MY_BIG_COMPANY_NAME
it shows MY_BIG_CO...
can i get the full text here.
thanks,
Kapil
Try setting the item margin:
Code: Select all
renderer.setItemMargin(0.5);
-
- Posts: 5
- Joined: Thu Oct 25, 2007 4:29 pm
- Location: India
- Contact:
-
- Posts: 59
- Joined: Fri Feb 23, 2007 7:41 am
If you are using the CategoryAxis, you can set the maximum number of label lines like this
Now, the labels will use 2 lines instead of one.
Regards,
Priya
Code: Select all
categoryAxis.setMaximumCategoryLabelLines(2);
Regards,
Priya
-
- Posts: 5
- Joined: Thu Oct 25, 2007 4:29 pm
- Location: India
- Contact:
this is how i am getting my chart
JFreeChart chart = ChartFactory.createBarChart("MyChart","countryPreference","Volume",dataset,PlotOrientation.VERTICAL,true,false,false);
in the dataset
dataset.addValue(currentRow.getCol3(), "",currentRow.getCol1());
currentRow.getCol1() Value is displayed below each graph.
this get trimmed to a short text with "..." to indicate incomplete text.
i need full text here.
can someone please guide me on how to achieve this
JFreeChart chart = ChartFactory.createBarChart("MyChart","countryPreference","Volume",dataset,PlotOrientation.VERTICAL,true,false,false);
in the dataset
dataset.addValue(currentRow.getCol3(), "",currentRow.getCol1());
currentRow.getCol1() Value is displayed below each graph.
this get trimmed to a short text with "..." to indicate incomplete text.
i need full text here.
can someone please guide me on how to achieve this
-
- Posts: 5
- Joined: Thu Oct 25, 2007 4:29 pm
- Location: India
- Contact:
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Did you try the suggestion about calling setMaximumCategoryLabelLines()? T hat's what I would have suggested. Also, you can try rotating the category labels by 90 degrees.kapilsharma wrote:i need full text here.
can someone please guide me on how to achieve this
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
A tooltip is a small text item in a box that appears in a client app user interface when the mouse pointer hovers over something for a short time. The ChartPanel class will display tooltips for some of the items in a chart (such as the bars) if they've been configured in the renderer.kapilsharma wrote:what is a tooltip in bargraph?
If you are a server-side developer, your users can also see these tooltips in a web browser if you create an HTML image map to go along with a chart image.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

