Hello. I need some help. I'll explain what I'm trying to achieve, hoping somebody could give me a guideline of where to start.
I need a 3 variable graphic, let's call the variables X, Y and Z. X horizontal axis, Y in vertical axis and Z showing color from a pre definied scale.
Let's say blue for 0.0 and red for 10.0 of Z value. I need to be able to define color for extremes of color scale. Is this possible ?.
Thanks in advance, best regards.
3 variable surface chart
Re: 3 variable surface chart
Hi Matias,
I'm afraid this series type doesn't exist. However, you can always inherit from TPointSeries (or whatever series you like), add a TValueList to it (your Z for the colors), a StartColor and an EndColor (or just an EndColor and use the already present Series' Color as StartColor) and recalculate the color for each point overriding GetValueColor function. Here it is how you could start:
Also note there is the TColorGrid series that also fits with the description you've made. I'd suggest you to take a look at the examples in the features demo and tell us if you don't find what you are looking for.
I'm afraid this series type doesn't exist. However, you can always inherit from TPointSeries (or whatever series you like), add a TValueList to it (your Z for the colors), a StartColor and an EndColor (or just an EndColor and use the already present Series' Color as StartColor) and recalculate the color for each point overriding GetValueColor function. Here it is how you could start:
Code: Select all
uses Series;
type RangePoint=class(TPointSeries)
private
ZValues: TChartValueList;
EndColor: TColor;
protected
function GetValueColor(ValueIndex:Integer):TColor; override;
end;
function RangePoint.GetValueColor(ValueIndex:Integer):TColor;
begin
result:=inherited GetValueColor(ValueIndex);
end;
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
with Chart1.AddSeries(RangePoint) as RangePoint do
begin
EndColor:=clRed;
ZValues:=TChartValueList.Create(Chart1[0], 'Z Values');
for i:=0 to 9 do
begin
ZValues.TempValue:=i;
Add(i);
end;
end;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |