Coloring Outliers on Box

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
Jesse
Newbie
Newbie
Posts: 28
Joined: Tue Mar 11, 2008 12:00 am
Location: Austin, TX

Coloring Outliers on Box

Post by Jesse » Thu Oct 16, 2008 11:47 pm

I am having trouble coloring the mild outliers on Box Plot independent from the color of the box.

Code: Select all

		ptr = teeBox.getMildOut();
		ptr.setHorizSize(7);
		ptr.setVertSize(7);
		ptr.setColor(Color.RED);
		ptr.getBrush().setColor(Color.RED);
		ptr.setInflateMargins(true);
		ptr.setStyle(PointerStyle.TRIANGLE);
		ptr.setVisible(true);
The size works. The shape works. However, the fill color seems to match the fill color of the box.

Am I doing this right?

Also, there are two setColor() calls in the above code. They appear to have the same effect internally, yet neither changes the outward appearance.

Jesse
Newbie
Newbie
Posts: 28
Joined: Tue Mar 11, 2008 12:00 am
Location: Austin, TX

Post by Jesse » Fri Oct 17, 2008 12:04 am

Is there a bug preventing the outlier color from being used?

From your source code (CustomBox.java):

Code: Select all

    public void drawValue(int index) {
        SeriesPointer tmp = null;

        double tmpVal = getSampleValues().value[index];

        // inside inner fences - no point
        if ((tmpVal >= innerFence1) && (tmpVal <= innerFence3)) {
            tmp = null;
        } else
        // mild outlined points
        if (((tmpVal >= innerFence3) && (tmpVal <= outerFence3)) ||
            ((tmpVal <= innerFence1) && (tmpVal >= outerFence1))) {
            tmp = mildOut;
        } else {
            // extreme outlined points
            tmp = extrOut;
        }

        if (tmp != null) {
            if (tmp.getVisible()) {
                Color tmpColor = getValueColor(index);
                tmp.prepareCanvas(chart.getGraphics3D(), tmpColor);
                if (iVertical) {
                    tmp.draw(calcXPosValue(dPosition), calcYPos(index),
                             tmpColor);
                } else {
                    tmp.draw(calcXPos(index), calcYPosValue(dPosition),
                             tmpColor);
                }
            }
        }
    }
tmpColor seems to not take the color from the brush!

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Oct 17, 2008 10:11 am

Hi Jesse,

Thanks for your report. I'll add your request to the wish-list to be investigated for next releases. However, tmpColor doesn't get pointer's brush colors, it gets series value colors so code below works fine for me here.

Code: Select all

        for (int i = 0; i<teeBox.getCount(); i++) {
            if ((teeBox.getYValues().getValue(i) > teeBox.getOuterFence3()) || 
                (teeBox.getYValues().getValue(i) < teeBox.getOuterFence1())) {
                teeBox.getColors().setColor(i, Color.RED);
            }
        }        
        
        ptr = teeBox.getMildOut();
        ptr.setHorizSize(7);
        ptr.setVertSize(7);
//        ptr.setColor(Color.RED);
//        ptr.getBrush().setColor(Color.RED);
        ptr.setInflateMargins(true);
        ptr.setStyle(PointerStyle.TRIANGLE);
        ptr.setVisible(true);
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Jesse
Newbie
Newbie
Posts: 28
Joined: Tue Mar 11, 2008 12:00 am
Location: Austin, TX

Post by Jesse » Fri Oct 17, 2008 2:11 pm

Well. That was a pretty safe answer. Add it to the wish list like it is a feature. I have to admit that this is frustrating.

Basically, you are saying that the pointer for the outliers ignores the values that it's methods define and that is expected behavior?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Oct 17, 2008 3:13 pm

Hi Jesse,

I'd like to apologise if you are not satisfied with my previous answer but it wasn't my intention to "underrate" your request.

In our issue tracking system we have different categories: Bug Report, Enhancement, Feature Request, Idea, etc. Calling it "bug list" or "wish list" is the less important since it is the same list with different kind of entries. So I have added this is an "Enhancement" as I thought drawValue should be modified to support pointer color settings as clearly it isn't designed for that at the moment. Therefore I think a paradigm shift may be necessary here and will confirm that when we've checked it, the status of the issue may change on review.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply