@@ -210,7 +210,7 @@ public static JFreeChart createHeatMapLegend(List<EMDataSet> dataSets, ChartOpti
210
210
chart .setBorderVisible (false );
211
211
chart .setBackgroundPaint (UIManager .getColor ("Table.background" ));
212
212
chart .setBackgroundImageAlpha (0.0f );
213
- chart .setPadding (new RectangleInsets (0.0 , 0.0 , 0.0 , 0 .0 ));
213
+ chart .setPadding (new RectangleInsets (0.0 , 0.0 , 0.0 , 20 .0 ));
214
214
215
215
final CategoryPlot plot = (CategoryPlot ) chart .getPlot ();
216
216
plot .setOutlineVisible (false );
@@ -281,27 +281,33 @@ public static JFreeChart createHeatStripsLegend(List<EMDataSet> dataSets, ChartO
281
281
false ); // urls
282
282
283
283
chart .setAntiAlias (true );
284
- chart .setBorderVisible (false );
285
- chart .setBackgroundPaint (UIManager .getColor ("Table.background" ));
286
- chart .setBackgroundImageAlpha (0.0f );
287
- chart .setPadding (new RectangleInsets (0.0 , 0.0 , 0.0 , 0.0 ));
288
-
289
- final CategoryPlot plot = (CategoryPlot ) chart .getPlot ();
284
+ chart .setBorderVisible (false );
285
+ chart .setBackgroundPaint (UIManager .getColor ("Table.background" ));
286
+ chart .setBackgroundImageAlpha (0.0f );
287
+ chart .setPadding (new RectangleInsets (0.0 , 0.0 , 0.0 , 0.0 ));
288
+
289
+ final CategoryPlot plot = (CategoryPlot ) chart .getPlot ();
290
290
plot .setOutlineVisible (false );
291
291
plot .setBackgroundPaint (UIManager .getColor ("Table.background" ));
292
292
plot .setInsets (new RectangleInsets (0.0 , 0.0 , 0.0 , 0.0 ));
293
293
plot .setDomainGridlinesVisible (false );
294
- plot .setRangeGridlinesVisible (false );
295
-
294
+ plot .setRangeGridlinesVisible (false );
295
+
296
296
final CategoryAxis domainAxis = (CategoryAxis ) plot .getDomainAxis ();
297
- domainAxis .setVisible (true );
298
- domainAxis .setAxisLineVisible (false );
299
- domainAxis .setTickMarksVisible (false );
300
- domainAxis .setTickLabelFont (UIManager .getFont ("Label.font" ).deriveFont (LookAndFeelUtil .getSmallFontSize ()));
301
- domainAxis .setLabelPaint (UIManager .getColor ("Label.foreground" ));
302
- domainAxis .setCategoryLabelPositions (CategoryLabelPositions .UP_90 );
303
- domainAxis .setMaximumCategoryLabelLines (1 );
304
- domainAxis .setCategoryMargin (0.0 );
297
+ domainAxis .setVisible (true );
298
+ domainAxis .setAxisLineVisible (false );
299
+ domainAxis .setTickMarksVisible (false );
300
+ domainAxis .setTickLabelFont (UIManager .getFont ("Label.font" ).deriveFont (LookAndFeelUtil .getSmallFontSize ()));
301
+ domainAxis .setLabelPaint (UIManager .getColor ("Label.foreground" ));
302
+ domainAxis .setMaximumCategoryLabelLines (1 );
303
+ domainAxis .setCategoryMargin (0.0 );
304
+
305
+ if (total > 4 ) {
306
+ domainAxis .setCategoryLabelPositions (CategoryLabelPositions .UP_90 );
307
+ domainAxis .setMaximumCategoryLabelWidthRatio (0.5f );
308
+ } else {
309
+ domainAxis .setMaximumCategoryLabelLines (2 );
310
+ }
305
311
306
312
final NumberAxis rangeAxis = (NumberAxis ) plot .getRangeAxis ();
307
313
rangeAxis .setVisible (false );
0 commit comments