views:

496

answers:

2

I am trying to draw some bar graphs with a data set that contains overlapping priorities.

E.g. three bars of different colors may be drawn at one point, but the one with the highest priority will be shown. This works most of the time, but I am getting some artifacts on my plot as some of the colors from lower priorities leak through occasionally. Any ideas of where I can look to fix this problem?

I thought it may have been an anti-aliasing issue, but turning it on or disabling it has no effect on the artifacts.

A: 

I'm not quite sure what you mean, but you probably should remove the priorities you don't want to see from the data model altogether, then they won't be painted at all.

banjollity
+1  A: 

When I've seen things like this before it was because I was graphing multiple data series, and for the most part there was a huge overlap in the datasets and only the last dataset rendered (top one) was visible most of the time. I suspect that whatever you are doing in your hide code might not be working as well as you think and the 'bleeding' of the other colours is the datasets where the overlap is less significant. Try an experiment and change the order in which your datasets are rendered - I'll bet that you see suddently that the predominant colours of your bars change.

Chris Boran
my 'hide' code is done by changing the render order, the problem was that datasets with a lower render priority still shows up occasionally. I found a workaround for this though.
yx
Do you mind if I ask how you worked around it? Something I didn't think of suggesting, but should work would be to remove the datasets and replace with an empty dataset when 'hiding'.
Chris Boran