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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Coloring dataplots based on longname
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

t.n.vader

Netherlands
Posts

Posted - 09/27/2010 :  03:22:59 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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?

t.n.vader

Netherlands
Posts

Posted - 09/27/2010 :  03:32:10 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Ah, sorry, I found it myself: I can use DataPlot-GetLegend()
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000