How to display a plot with hi-low-area style?

Artyom D.
Kursk,

Sep 24, 2009
8 Posts

0  |  0  

Re: How to display a plot with hi-low-area style?

Hi,
I’d like to draw ADC signal within a day. Prior it I calculates averages, maxs & mins in time intervals. Looking over AChart styles I found out that more appropriate view for simultaneous representation of avgs, maxs & mins is a plot with hi-lo-area. So it looks like I need to invoke SetData using two dimension array for Y-values. Please give me an example of calling SetData?
Thank you,
Artyom

Victor B.
Lake Forest, CA

Sep 25, 2009
93 Posts

0  |  0  

Re: How to display a plot with hi-low-area style?

Hi Artyom,

Since I don't know where you are in your program, I will start from the beginning.  To simulate your situation, I created a form with an AChart with the 'Style' type set to 'Hi-Lo Area'.

I created the variable i (type long) and the variables adMinMax[2][100] and adTime[100] (both type Double) and then initialized the variables:

for i=0 to 99 do
    adMinMax[0][i] = 15 + (i mod 4)
    adMinMax[1][i] = 30 - (i mod 7)
    adTime[i]=i
next

To populate the chart, I used the commands:

cht1.SetData("Plot1" ,adMinMax[0], adTime, , , False)
cht1.SetData("Plot1" ,adMinMax[1], adTime, , , False)

Each command draws a line of x-y data to Plot1.  Once both lines are drawn, the area between will be shaded in.

Regards,
Victor Brode

Artyom D.
Kursk,

Oct 5, 2009
8 Posts

0  |  0  

Re: How to display a plot with hi-low-area style?

Hi, Victor,
Sorry for the delay in answering.  I’ve tested the code you supplied and it works fine. I’ve also found out that in order to draw the middle values (averages) on one plot I should call appropriate SetData first. After that SetData with maxs & mins can be invoked. Last question:  I change color of overlying area (relatively to middle values) using FillToBaseColor property of a plot. Is there a way to fill underlying area that always has white color?
Thank you,
Artyom

Solution Available
Victor B.
Lake Forest, CA

Oct 6, 2009
93 Posts

1  |  0  

Re: How to display a plot with hi-low-area style?

Hi Artyom,

The underlying area color is a fixed color.  If you want to set both of the colors, you can create two plots on your chart and SetData for Min values first and Averages second on one Plot.  Then SetData for Averages first and Max values second on the second plot.

cht1.SetData("Plot1",adMin, adTime, , , False)
cht1.SetData("Plot1",adAverage, adTime, , , False)

cht1.SetData("Plot2",adAverage, adTime, , , False)
cht1.SetData("Plot2",adMax, adTime, , , False)

cht1.Plots("Plot1").FillToBase=True
cht1.Plots("Plot2").FillToBase=True
cht1.Plots("Plot1").FillToBaseColor=aclrRed
cht1.Plots("Plot2").FillToBaseColor=aclrYellow

Regards,
Victor Brode (Geotest)



Please Note
You need to have a M@GIC account to participate in the Forums.
Not yet registered on our website? Click here to register today!

All content, information and opinions presented on the Marvin Test Solutions User Forums are those of the authors of the posts and messages and not Marvin Test Solutions'. All attachments and files are downloaded at your own risk. [Read More]