visualdatatools.com Forum Index visualdatatools.com
Discussion for DataTank and DataGraph
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Getting Line Style Color

 
Post new topic   Reply to topic    visualdatatools.com Forum Index -> DataGraph Framework
View previous topic :: View next topic  
Author Message
Joe Brain



Joined: 18 Apr 2007
Posts: 120

PostPosted: Mon Oct 05, 2009 4:28 pm    Post subject: Getting Line Style Color Reply with quote

To set a color on my Plot & Lines commands, I'm doing a -setColor:forEntry: where I enter @"Line Style" for the entry.

The colors are working correctly. However, when I try to -getColor:forEntry: it seems to always return nil.

Is there any way to get the NSColor back from my command?

-JB
Back to top
View user's profile Send private message
David
Site Admin


Joined: 25 Nov 2006
Posts: 1963
Location: Chapel Hill, NC

PostPosted: Tue Oct 06, 2009 9:41 am    Post subject: Reply with quote

I added a new class DGLineStyleSettings. So get it from the plot command
Code:
- (DGLineStyleSettings *)line;

This is similar to the fill controller, and allows you to set and get line style properties.
Code:
- (void)setColorType:(DGColorNumber)num;
- (void)setColor:(NSColor *)col;
- (void)setWidth:(CGFloat)width;
- (void)setPattern:(DGSimpleLineStyle)line;

- (DGColorNumber)colorType;
- (NSColor *)color;
- (CGFloat)width;
- (DGSimpleLineStyle)pattern;


David
Back to top
View user's profile Send private message Send e-mail
Joe Brain



Joined: 18 Apr 2007
Posts: 120

PostPosted: Tue Oct 06, 2009 10:02 pm    Post subject: Reply with quote

Awesomely useful.

I've noticed I can use -line for Bar, Box, Histogram, Plot, and Range, but I get an unrecognized selector when I send it to a "Lines" type command.

Any way to get around this?

Thanks!!
-JB
Back to top
View user's profile Send private message
David
Site Admin


Joined: 25 Nov 2006
Posts: 1963
Location: Chapel Hill, NC

PostPosted: Tue Oct 06, 2009 10:26 pm    Post subject: Reply with quote

I added a DGLinesCommand command, and that has a line method. (Just uploaded a new version).

David
Back to top
View user's profile Send private message Send e-mail
Joe Brain



Joined: 18 Apr 2007
Posts: 120

PostPosted: Wed Oct 07, 2009 2:30 am    Post subject: Reply with quote

It looks fantastic as always, thanks!

-JB

Edit: Implemented & works perfectly; cleans up a lot of my ugly code too Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    visualdatatools.com Forum Index -> DataGraph Framework All times are GMT - 3 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group