06-26-2009 10:19 AM
I am kind of a newbie at MS.net, so please bear with my ignorance.
I am writing an app using VB 2005 where the user can select the number of channels to be displayed. Does anyone have a code snippet that adds legend items dynamically, changes the color of the various plots, etc.?
Thanks!
06-29-2009 05:41 PM
I have not been able to find any "snippet's" of code that will do everything that you are looking for on the community or anything along those lines. However you should be able to use the following function calls to modify the aspects of your Program to make it do what you want.
Line Color: Use the method Line Color on you Object (Plot name) to se the color. In your case you will likely have to put your plot names in some array and there you could each plot by their name or position in that array.
EXAMPLEPLOTNAME.LineColor = Color.CornflowerBlue
The legend might be a bit trickier as you will need to programatically associate a given legend Item to each plot directly and then once thats done you could make them visible or not. Unfortunately I have not had time to look at this in VB. If time permits tomorrow I will attempt to look into it. Unfortunately in general I think you will have to code this directly for your applicatio, unless someone else has a code section they are willing to provide you.