I have a CombinedDomainCategoryPlot made up of several supblots. Each subplot may have up to 15 bars in it (3 series in 5 categories). However one subplot only has 1 bar in the 3rd series of the 5th category. In my case this causes the single bar to be drawn in the middle of the chart in which case it is aligned in the wrong category. Additionally, it is being rendered as if it is a member of the 1st series in it's category, when it is actually the 3rd. I'm assuming this is because it's the only bar being rendered, and the renderer renders the bar based on the order it receives it as opposed to it's actual series (please correct me if I'm wrong).
Anyway, is there a built in solution to fix this? If not, I'm thinking I'd need to pad the DefaultCategoryDataset and fill it with the maximum number of series that I can expect. If I have to do this, I'd like to avoid using a bunch of 0 values because some of my actual series are equal to 0, and this would cause some confusion. Is there a way to deal with this? One option would be to use a negative value, and render bars with negative values in a way that they would not be visible.
Summary: I have a subplot on a Combined Plot that only has one bar. It's single bar is being rendered in the middle of the chart, and is not aligned with bars from the same category and series in the other subplots. How do I fix this?
CombinedDomainCategoryPlot Alignment of Subplots
-
- Posts: 844
- Joined: Fri Oct 13, 2006 9:29 pm
- Location: Sunnyvale, CA
Re: CombinedDomainCategoryPlot Alignment of Subplots
You could insert null values into the dataset. The null value would not be drawn (unlike 0 or a negative value), but it will pad out the data to have the bars line up. The other option is to create a custom dataset that implements the CategoryDataset interface to manage the data as you see fit.Reggie3 wrote:Summary: I have a subplot on a Combined Plot that only has one bar. It's single bar is being rendered in the middle of the chart, and is not aligned with bars from the same category and series in the other subplots. How do I fix this?
Richard West
Design Engineer II
Advanced Micro Devices
Sunnyvale, CA
Design Engineer II
Advanced Micro Devices
Sunnyvale, CA