TeeChart Pro 2013 and TDottedGrayPen
Posted: Mon Feb 17, 2014 4:52 am
I have recently upgraded from TeeChart 8 to TeeChart 2013. I now have a problem with the Get_DottedGrayPen in the following code. Grid is now interpreted as TAxisGridPen, not TDottedGrayPen.
Code: Select all
procedure TformMultipleUnitPrint.Get_AxisTicks(doc:TDOMDocumentXPath;sprefix:string;
aAxis:TChartAxis);
const
sGRIDCENT = '/ticks/gridcentered';
sTICKLEONLY = '/ticks/tickonlabelsonly';
sTICKLEN = '/ticks/ticklength';
sTICKINNERLEN = '/ticks/tickinnerlength';
begin
with aAxis do
begin
GridCentered := XMLReadBoolean(doc,sPrefix+sGRIDCENT,GridCentered);
TickOnLabelsOnly:=XMLReadBoolean(doc,sPrefix+sTICKLEONLY,TickOnLabelsOnly);
TickLength := XMLReadInteger(doc,sPrefix+sTICKLEN,TickLength);
TickInnerLength:=XMLReadInteger(doc,sPrefix+sTICKINNERLEN,TickInnerLength);
Get_ChartAxisPen(doc,sPrefix+'/ticks/axis',Axis);
Get_DottedGrayPen(doc,sPrefix+'/ticks/grid',Grid); /// <<< Problem here >>>
Get_DarkGrayPen(doc,sPrefix+'/ticks/ticksmain',Ticks);
Get_DarkGrayPen(doc,sPrefix+'/ticks/ticksinner',TicksInner);
end;
end;
procedure TformMultipleUnitPrint.Get_DottedGrayPen(doc:TDOMDocumentXPath;sP:string;
aPen:TDottedGrayPen);
const
sCOL = '/colour';
sENDSTYLE = '/endstyle';
sSMALLDOTS = '/smalldots';
sSTYLE = '/style';
sVISIBLE = '/visible';
sWIDTH = '/width';
var
sResult : string;
begin
with aPen do
begin
Visible := XMLReadBoolean(doc,sP+sVISIBLE,Visible);
SmallDots := XMLReadBoolean(doc,sP+sSMALLDOTS,SmallDots);
Width := XMLReadInteger(doc,sP+sWIDTH,Width);
Color := XMLReadColor(doc,sP+sCOL,Color);
{** end style}
sResult := ReturnXResult(doc,sP+sENDSTYLE);
if (sResult <> '') then
begin
if (sResult = 'esRound') then
EndStyle := esRound
else if (sResult = 'esSquare') then
EndStyle := esSquare
else if (sResult = 'esFlat') then
EndStyle := esFlat;
end;
{** style}
sResult := ReturnXResult(doc,sP+sSTYLE);
if (sResult <> '') then
begin
if (sResult = 'psSolid') then
Style := psSolid
else if (sResult = 'psDash') then
Style := psDash
else if (sResult = 'psDot') then
Style := psDot
else if (sResult = 'psDashDot') then
Style := psDashDot
else if (sResult = 'psDashDotDot') then
Style := psDashDotDot
else if (sResult = 'psClear') then
Style := psClear
else if (sResult = 'psInsideFrame') then
Style := psInsideFrame;
end;
end;
end;