LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change programmatically the color of a graph frame ?

I want to change programmatically the color of the frame of a graph, while keeping its 3D style, but I could not find the corresponding attribute node (please don't laught !!).
The only solution I found is rather complicated :
1/ make the frame transparent
2/ put a decoration (3D style) behind the graph
3/ manage to keep the same size and position for both
4/ dig for a ref to the decoration (nice exercice)
5/ play with "to more specific class" to reach a color attribute node for the decoration
6/ change the color (FG) of the decoration

Ouuuuf !...

Is there a better way ?
Chilly Charly    (aka CC)
0 Kudos
Message 1 of 10
(5,801 Views)
That sounds about right..

I don't know of a more direct method... I had to do this about a year ago.

Once everything is defined, it is easy to implement.
The first one is a pain (I meant a fun exercise) ;o)

-JLV-
Message 2 of 10
(5,801 Views)
Humf... 😞
I forgot to include the hunt for the right decoration behind, really exciting when there are several graphs to play with !
Don't you think a "frame color" attribute would do the job more painlessly ?
Pleeaaase NI !!!! :-))
Chilly Charly    (aka CC)
0 Kudos
Message 3 of 10
(5,801 Views)

McCharly,

 

A simple "please" won't do for NI.

 

Have you tried "pretty please with sugar on top"?

 

It has been 6 years.

 

You would have thought that they would have added this attribute by now.

 

Looks like NI has been giving you the cold sholder.

 

Do you feel the coldness McChilly?

 

Have you ever tried putting a TAB inside a CLUSTER?

 

That should warm you up a bit.

 

McKevin.

0 Kudos
Message 4 of 10
(5,237 Views)

 


@kmcdevitt wrote:

 

You would have thought that they would have added this attribute by now.

 


 

 

Why would you think that?

 

 

 

 


Have you ever tried putting a TAB inside a CLUSTER?

 


That's already something more needed (and I said as much).

 


___________________
Try to take over the world!
0 Kudos
Message 5 of 10
(5,229 Views)

 


tst wrote:

@kmcdevitt wrote:

 

You would have thought that they would have added this attribute by now.

 


 

Why would you think that?


 

With no disrespect, in the same tone of voice, and font size, I respond:

 

Why would you not think that?

 

 

 

 

 


tst wrote:

@kmcdevitt wrote:

 

Have you ever tried putting a TAB inside a CLUSTER?

 


That's already something more needed (and I said as much).

 


Indeed.  Needed more desperately.  We could have save the world... (and I said even much more on that).

 

 

0 Kudos
Message 6 of 10
(5,212 Views)

 


@kmcdevitt wrote:

 


tst wrote:

@kmcdevitt wrote:

 

You would have thought that they would have added this attribute by now.

 


 

Why would you think that?


 

With no disrespect, in the same tone of voice, and font size, I respond:

 

Why would you not think that? 


 

Because doing nothing is the default option. There are many things that people requested over the years and every single one of them would require work for it to be implemented.

 

For a feature to be implemented any or all of the following would have to happen:

 

  1. Someone relevant at NI has to notice it (which may well not have happened in this case).
  2. Someone has to review it.
  3. Someone has to decide to do it (instead of doing something else).
  4. Someone needs to assign manpower and time to do it.
  5. Someone needs to design it.
  6. Someone needs to do it.
  7. Someone needs to test it.
  8. Someone needs to document it.

___________________
Try to take over the world!
0 Kudos
Message 7 of 10
(5,195 Views)

@chilly charly wrote:
4/ dig for a ref to the decoration (nice exercice)
5/ play with "to more specific class" to reach a color attribute node for the decoration

Chilly,

Regarding #4. An easy way to get/set the ref of a specific decoration is to filter by size, either width or height or both. If I have 3 charts and want to change the "border" of them (i.e. the decoration behind it), I'll set the widths of the three charts different, such as 445, 446, and 447. This is barely noticable to the eye. To change the color, simply filter by size.

Richard






0 Kudos
Message 8 of 10
(5,181 Views)

There is a workaround (as long as you can live with legend background color...)

 

  1. create vi with layout you like
  2. set graph frame color to transparency
  3. set pane color to desired color, (add as many splitter as you like and colors)

Create another vi with subpanels.

Load subpanels with your graphs.vi (as clones)

Change clones colors programmatically anyway or order you like

 

Artur

 

P.S. how to pass events from one vi to another is not a problem, right?

0 Kudos
Message 9 of 10
(5,167 Views)

It was fun to create prototupe from first posting ...

For some applications it would be simpler and quicker then mine.

Artur

0 Kudos
Message 10 of 10
(5,154 Views)