Clip series graphics to axis bounds?

Get help and support using chartsEngine for LiveCode.

Moderators: heatherlaine, BvG

Post Reply
dglass
Posts: 519
Joined: Thu Sep 24, 2009 9:10 pm
Location: California
Contact:

Clip series graphics to axis bounds?

Post by dglass » Wed Jul 06, 2011 5:42 am

Is there a way to clip the drawing of the chart's series to the area bounded by the chart's axes?
LiveCodeScreenSnapz025.jpg
overrunning the axes
In the screenshot, I would like to clip the colored, stacked-line portion of the chart so it doesn't extend outside the axes on the left and right edges.

I would rather not have to recalculate the data in order to do the clipping.

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1236
Joined: Sat Apr 08, 2006 1:10 pm
Location: Zurich
Contact:

Re: Clip series graphics to axis bounds?

Post by BvG » Wed Jul 06, 2011 7:45 am

Looks like a bug to me. Can you give me the charts["data"] that you use? Do you also set the charts["gridX"], or charts["minX" or "maxX"]? If you want you can also simply send me an example stack, and I'll look into it.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

dglass
Posts: 519
Joined: Thu Sep 24, 2009 9:10 pm
Location: California
Contact:

Re: Clip series graphics to axis bounds?

Post by dglass » Wed Jul 06, 2011 5:45 pm

I can try to give you the data I'm using. I made some changes last night to how the chart gets drawn, and am now having trouble getting it to do what I show in the screenshot.

I can also try to break it out into a small sample project, as soon as I can recreate what I was seeing yesterday.

I do set the gridX, minX, and maxX values.

dglass
Posts: 519
Joined: Thu Sep 24, 2009 9:10 pm
Location: California
Contact:

Re: Clip series graphics to axis bounds?

Post by dglass » Wed Jul 06, 2011 6:00 pm

Sample attached.

If the MinX is after the earliest X value, then the chart is drawn too far to the left.
If the MaxX is before the last X value, then the chart is drawn too far to the right.
Attachments
Chart Overrun Example.livecode.zip
chart overrun example
(2.75 KiB) Downloaded 254 times

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1236
Joined: Sat Apr 08, 2006 1:10 pm
Location: Zurich
Contact:

Re: Clip series graphics to axis bounds?

Post by BvG » Fri Jul 08, 2011 3:26 pm

Sadly, i have no time to check if this is a bug or not right now. I will get back to you on this problem after Sunday.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

Post Reply

Return to “chartsEngine”