The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Coloring dataplots based on longname

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
t.n.vader Posted - 09/27/2010 : 03:22:59 AM
Hello,

I have a graph with one layer and multiple line plots. The columns providing the data for the plots have long names like "V=-5", V="4" and "V=15". These names also appear when you add a legend. I want to change the color of each plot, according to this name.

I can access and recolor all graphs without a problem

GraphLayer gl = Project.ActiveLayer();
if( !gl.IsValid() ) {
	out_str( "Please activate the graph to color" );
	exit(0);
}

out_str("Coloring");

foreach( DataPlot dp in gl.DataPlots ) {
	dp.SetColor(RGB2OCOLOR(RGB(123,45,67)), true);
}


I also don't expect any problems deriving a color from a descriptive string. I cannot, however, find the longname I need. All I manage to retrieve is the DatasetName (for example "Book37_AI").

How can I retrieve the long name of the column?
1   L A T E S T    R E P L I E S    (Newest First)
t.n.vader Posted - 09/27/2010 : 03:32:10 AM
Ah, sorry, I found it myself: I can use DataPlot-GetLegend()

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000