Home >Java >javaTutorial >Why Doesn't Hiding Series Rescale the Shared Domain Axis in a CombinedDomainXYPlot?
Shared Domain Axis Scaling in CombinedDomainXYPlot
When using a CombinedDomainXYPlot, which combines multiple datasets with a shared domain axis, adjusting the visibility of a series does not automatically rescale the domain axis. This behavior may seem unintuitive, given that the range axes scale accordingly.
Understanding the Issue
CombinedDomainXYPlot establishes a combined maximum range for its shared domain axis to enable axis sharing. Changing the visibility of a series does not affect this shared domain axis. However, updating the dataset triggers a reconfiguration of the shared domain axis, allowing for rescaling.
Solution
To update the shared domain axis manually, use the configure() method of the domain axis. This will force the scaling of the domain axis based on the current dataset and its combined maximum range.
Additional Considerations
Example Implementation
The code snippet below demonstrates how to manually refresh the scaling of the domain axis using the configure() method:
mainPlot.getDomainAxis().configure();
This should update the domain axis to reflect the current dataset and its combined maximum range. However, toggling setAutoRange() to true after setting the dataset may not have the desired effect since the data and its combined maximum range remain unchanged.
The above is the detailed content of Why Doesn't Hiding Series Rescale the Shared Domain Axis in a CombinedDomainXYPlot?. For more information, please follow other related articles on the PHP Chinese website!