Hi,
I have three arrays of data to show on the chart.
on x-axis : XArray[10000] with the date-time information
on y-axis : YHighArray[10000] and YLowArray[10000] data information with respect to the date-time in XArray[10000].
Could you please tell me how to add the above three arrays data to THighLowSeries, which is added during the run time ?
How to make Lines (between the High Pen and Low Pen) invisible programmatically ?
I tried to use the transparency option, but it is only working for the Series style lines between the high and low pen, not for the high-low pen colour(i.e it is only working for the brush not for the pen colour). I have to make whole series transparency (including pen colour). Could you please tell me, how to make this programmatically ?
thanks in advance,
High-Low Series, Trasparency, add three arrays of data
Re: High-Low Series, Trasparency, add three arrays of data
Hello,
Here you have the full example I have played with:
You should loop the arrays and use the AddHighLow method. Ie:skng wrote:Could you please tell me how to add the above three arrays data to THighLowSeries, which is added during the run time ?
Code: Select all
for i:=Low(XArray) to High(XArray) do (Chart1[0] as THighLowSeries).AddHighLow(XArray[i], YHighArray[i], YLowArray[i]);
Use the Pen.Visible property of the series:skng wrote:How to make Lines (between the High Pen and Low Pen) invisible programmatically ?
Code: Select all
(Chart1[0] as THighLowSeries).Pen.Visible:=false;
You should use TTeeCanvas.ColorFrom. Ie:skng wrote:I tried to use the transparency option, but it is only working for the Series style lines between the high and low pen, not for the high-low pen colour(i.e it is only working for the brush not for the pen colour). I have to make whole series transparency (including pen colour). Could you please tell me, how to make this programmatically ?
Code: Select all
//High/Low Transparencies (between 0 and 255)
(Chart1[0] as THighLowSeries).HighPen.Color:=TTeeCanvas.ColorFrom((Chart1[0] as THighLowSeries).HighPen.Color,150);
(Chart1[0] as THighLowSeries).LowPen.Color:=TTeeCanvas.ColorFrom((Chart1[0] as THighLowSeries).LowPen.Color,150);
Code: Select all
uses ErrorBar, TeCanvas, DateUtils;
var XArray, YHighArray, YLowArray: array of double;
const mySize=10000;
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
Chart1.View3D:=false;
Chart1.Legend.Visible:=false;
SetLength(XArray, mySize);
SetLength(YHighArray, mySize);
SetLength(YLowArray, mySize);
XArray[0]:=Today;
YHighArray[0]:=50+random*100;
YLowArray[0]:=50+random*100;
for i:=1 to mySize-1 do
begin
XArray[i]:=IncDay(XArray[i-1]);
YHighArray[i]:=YHighArray[i-1]+random*10-5;
YLowArray[i]:=YLowArray[i-1]+random*10-5;
end;
with Chart1.AddSeries(THighLowSeries) as THighLowSeries do
begin
//FillSampleValues();
BeginUpdate;
try
for i:=Low(XArray) to High(XArray) do AddHighLow(XArray[i], YHighArray[i], YLowArray[i]);
finally
EndUpdate;
end;
Pen.Visible:=false;
//High/Low Transparencies (between 0 and 255)
HighPen.Color:=TTeeCanvas.ColorFrom(HighPen.Color,150);
LowPen.Color:=TTeeCanvas.ColorFrom(LowPen.Color,150);
end;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |