how can i line up the borders of various charts? the charts are different objects in one jpanel, right now the RSI panel is in BorderLayout.SOUTH.
i'd like to change the fontsize of all numbers, texts, too.
tia,
ulrich
borders of multiple charts not lined up
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
This is, unfortunately, a limitation of the layout procedure used by JFreeChart. It's great for ensuring that charts look reasonable at many different sizes, but terrible for making sure two or more charts are "aligned".
In the combined charts, a workaround had to be applied where the code calculates the dimensions of the axes for all the subplots BEFORE the plots are drawn, then the maximum size is applied to all axes using the setFixedDimension(...) method (in the Axis class). You might be able to do something similar, but it would be messy.
Regarding the font sizes, there are methods in various places for controlling those. But from the image you posted, it looks like one problem you have is that the lower chart has a height that is less than the default minimum drawing height (set in the ChartPanel class). When that happens, the chart is drawn at a larger size, then scaled down to fit the available space. You could experiment with a lower default value to see if it improves the appearance of the fonts.
In the combined charts, a workaround had to be applied where the code calculates the dimensions of the axes for all the subplots BEFORE the plots are drawn, then the maximum size is applied to all axes using the setFixedDimension(...) method (in the Axis class). You might be able to do something similar, but it would be messy.
Regarding the font sizes, there are methods in various places for controlling those. But from the image you posted, it looks like one problem you have is that the lower chart has a height that is less than the default minimum drawing height (set in the ChartPanel class). When that happens, the chart is drawn at a larger size, then scaled down to fit the available space. You could experiment with a lower default value to see if it improves the appearance of the fonts.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
hi david,
thanks for reply.
setDrawMinimumHeight worked great (i only changed the size of macd):
thanks for this very good lib,
ulrich
thanks for reply.
setDrawMinimumHeight worked great (i only changed the size of macd):
now i have to change the title font size and if possible alignment, can you tell me where? i tried chartpanel.setFont() already .... i am sorry, it's an open source project and we can't pay for commercial support ...Regarding the font sizes, there are methods in various places for controlling those
thanks for this very good lib,
ulrich