I put my Gantt Chart (ChartPanel) in a JScrollPane,and create a button named [zoom in].
The function for the button [zoom in] is:
When I click [zoom in] button, the widt
Absent a complete example, this appears to be an artifact of adding a ChartPanel
directly to a JscrollPane
. Instead, use a SlidingGanttCategoryDataset which permits the use of setFirstCategoryIndex()
in response to a scrollbar state change. SlidingGanttDatasetDemo1 is a complete example.
I got the answer to solve my problem.
Call ChartPanel.setMinimumDrawWidth/Height with small value and ChartPanel.setMaximumDrawWidth/Height with large values than exceed the screen size of your monitor. Then, the ChartPanel will be scaled without being distorted.
Please refer to: How to aviod axis label and legend scaling