05-17-2011 03:29 AM
Hello,
I want to ask something. I’ve been trying to develop my report of graphs and I have some problems about changing colors. I have more than 10 graphs at my report in each page. For every graph I have limit lines. I want to change the color of the signal in graph where the signal is out of the limits. I uploaded an example picture. Could you please help me about this?
Solved! Go to Solution.
05-17-2011 02:17 PM
Hello No_RegreTs,
My suggestion is to use the "Palette" function in DIAdem REPORT. Here's how you can set this up:
Double click onto the CURVE you wish to change color, it will get you to this dialog. Change the Line color parameter from whatever color it has to "Palette" (see screen shot below):
A new bottom labeled "Color Palette" will show up in the dialog, click on that button.
Change the parameters as seen in the dialog below:
The important ones are:
"Number of colors" - that should be set to 3, since we will have three colors (one for above, one for below, and one for within the limits.
"Color allocation ..." - This needs to be set to "Input values" because you want to set these limits to meet your needs.
Depending on what you selected for "Number of colors, a number of rows will show up in the lower part of the dialog. Select your colors and the ranges to which each color applies here. The Screenshot shows an example for red being the "above and below limit" color and blue the actual curve color.
This is the result:
I hope that helps. Let us know if you have more questions,
Otmar
05-17-2011 07:11 PM
Thank about your answer but it changes only a graph. But I have 15 different graph and their limits are different. And the limits are changable not a constant.
05-17-2011 08:35 PM
Hi No_RegreTs,
Most people solve this scenario by creating one or two copies of the data channel with the values in range set to NoValue and the high/low values left as they were. Then you plot these altered plots on top of the original, and you have the display you're after. The CTNV() or IIF() functions in the ChnCalculate() command are the simplest ways to mask values with NoValues for the extra channel(s).
Brad Turpin
DIAdem Product Support Engineer
National Instruments
05-17-2011 10:57 PM
@No_RegreTs wrote:
Thank about your answer but it changes only a graph. But I have 15 different graph and their limits are different. And the limits are changable not a constant.
Hello No_RegreTs,
This can be done on a "per graph" basis, i.e. every graph can have it's own set of color change values.
Also, the variables that define the limits can be changed programmatically:
Specifies the interval limits within which DIAdem displays the y-values in the specified colors of the color palette.
Definition | D2CurvePalLimit(i), Real variable i = 1 ... 250 |
Note You must use the following object hierarchy to access the variable:Call GraphObjOpen(2D-AxisName) Call GraphObjOpen(2D-CurveName) D2CurvePalLimit(i) = Value Call GraphObjClose(2D-CurveName) Call GraphObjClose(2D-AxisName) Use the object names to open the subobject and the main object, to access the variable, and to close the subobject and the main object again. If you do not know the object name, use the object type to find the object name. Type of main object: 2D-Axis or 2D-Polar Type of subobject: 2D-Curve |
I don't see any reason why what you want to do could not be done using the method I described, unless I am missing some information.
Example, with each graph having different limits and colors:
Hope that helps,
Otmar