左の縦軸を持つ共通の棒グラフを想定します...チャートの左側と縦軸の間のスペースをどうすれば制御できますか?軸上に表示される目盛ラベルが大きくなるたびに、軸が目盛りラベルに対応するように右にプッシュされるという考えがあります。私は、軸がグラフの全幅の20%で常に表示されるべきであることを指定できるようにしたいと考えています。これは可能ですか?JFreeChartの軸の位置
0
A
答えて
0
通常、棒グラフにはドメインのCategoryAxis
があるため、setLowerMargin()
,setUpperMargin()
およびsetCategoryMargin()
を試してみるとよいでしょう。
0
あなたは範囲軸に固定された軸のスペースを設定する必要があります。 http://www.jfree.org/jfreechart/api/gjdoc/org/jfree/chart/plot/XYPlot.html#setFixedRangeAxisSpace:AxisSpace
あなただけのチャート画像を作成していると仮定:
// Get your plot from the chart object..
XYPlot plot = (XYPlot)chart.getPlot();
// Create an instance of the image so we can do some calculations
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
// Create an instance of the Graphics2D from your image
Graphics2D g2 = image.createGraphics();
// Get the reserve space that jfree chart sets aside for the axis
AxisSpace space = yAxis.reserveSpace(g2, plot, new Rectangle(width,height), plot.getRangeAxisEdge(), plot.getFixedRangeAxisSpace());
// Give that space a fixed width
space.setLeft(fixedAxisWidth);
// Set it in the plot
plot.setFixedRangeAxisSpace(space);
あなただけ行くことなくAxisSpaceを定義することができるかもしれませんすべてのGraphics2D rigamaroleを通じて、これは私が過去にそれをやった方法です。
関連する問題
- 1. X軸のJFreeChartテーブル?
- 2. サブタイトルの位置をカスタマイズする - JFreeChart
- 3. コアプロットチャート軸位置
- 4. d3 y軸ラベルの位置
- 5. JfreeChartの自動スケールY軸
- 6. JFreeChart(一部)x軸の値
- 7. Y軸ははJFreeChart
- 8. Matplotlibの軸の位置とカラーバーのアライメント
- 9. 3Dのmatplotlibの:x軸の位置に
- 10. Snap.svg 2d軸での位置のアニメーション
- 11. wpfツールキットチャートの軸のタイトル位置
- 12. 軸のボタン位置決め(matplotlib)
- 13. D3ツリーノードの位置をX軸にバインド
- 14. X、Y軸の設定範囲-JfreeChart
- 15. ggplotの軸のタイトルの位置、相対配置?
- 16. D3散布図動的軸位置
- 17. y軸の間違った位置にスプライトを配置
- 18. php pchart 2.0 x軸の横軸の位置(上段ではなく下段)
- 19. 現在のアンドロイドのゲームパッドの軸の位置を取得する
- 20. D3.js x軸とy軸の位置/オフセットを取得する方法
- 21. Chart.jsのx軸ラベルの位置を変更する方法
- 22. x軸のオブジェクトのランダムな位置を設定する
- 23. ggplot2極座標プロットの軸ラベルの位置
- 24. バックグラウンド位置のX軸のみをアニメ化する
- 25. JFreeChartの棒線と軸線の間隔を取り除く
- 26. x軸に沿ったJFreeChartの複数のツールチップ
- 27. JFreeChart - Ring Plotシンプルなラベルの配置
- 28. バープロットとベースプロットのY軸位置が一致しない
- 29. plt.Matshowでx軸の位置を上から下に変更
- 30. 軸の位置を調整するggplot2ファセット