Java Web アプリケーションの BAR チャートに次の値を表示します。9.46373791E8 9.45942547E8 9.45559945E8 9.45187023E8 9.44856693E8 9.44417826E8 9.44007878E8
ご覧のとおり、値は非常に近く、わずかな違いがあります。Jfreechart を使用して棒グラフを生成すると、すべての棒がほぼ同じ高さで表示され、違いを視覚的に伝える方法がありません。したがって、(0,0) を (0,9) に変更して、x 軸が y 軸の 9 番になるようにします。バーが表す実際の値をバーの上のどこかに表示したいと考えています。
アイデアを提案してください。私は以下を試しましたが、うまくいきませんでした
Double d=(double) 9;
ValueAxis rangeAxis = plot.getRangeAxis();
rangeAxis.setLowerMargin(d);
編集:これは参考のための私のオリジナルのプログラムです
JFreeChart chart =
ChartFactory.createBarChart(
title,
"File Date",
"File Size",
dataset,
PlotOrientation.VERTICAL,
true,
true,
false);
chart.setBackgroundPaint(Color.white);
// Set the background color of the chart
chart.getTitle().setPaint(Color.DARK_GRAY);
chart.setBorderVisible(true);
// Adjust the color of the title
CategoryPlot plot = chart.getCategoryPlot();
plot.getRangeAxis().setLowerBound(d);
// Get the Plot object for a bar graph
plot.setBackgroundPaint(Color.white);
plot.setRangeGridlinePaint(Color.blue);
CategoryItemRenderer renderer = plot.getRenderer();
renderer.setSeriesPaint(0, Color.decode("#00008B"));