You've already forked lazarus-ccr
fpspreadsheet: Implement writing of wall and floor chart styles.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8973 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -34,6 +34,18 @@ begin
|
|||||||
|
|
||||||
ch.Border.Color := scWhite;
|
ch.Border.Color := scWhite;
|
||||||
ch.Border.Style := clsSolid;
|
ch.Border.Style := clsSolid;
|
||||||
|
|
||||||
|
ch.PlotArea.Background.Style := fsSolidFill;
|
||||||
|
ch.PlotArea.Background.FgColor := $1F1F1F;
|
||||||
|
{$ELSE}
|
||||||
|
ch.Background.FgColor := scWhite;
|
||||||
|
ch.Background.Style := fsSolidFill;
|
||||||
|
|
||||||
|
ch.Border.Color := scBlack;
|
||||||
|
ch.Border.Style := clsSolid;
|
||||||
|
|
||||||
|
ch.PlotArea.Background.Style := fsSolidFill;
|
||||||
|
ch.PlotArea.Background.FgColor := $F0F0F0;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
ch.Title.Caption := 'HALLO';
|
ch.Title.Caption := 'HALLO';
|
||||||
|
@ -747,11 +747,11 @@ begin
|
|||||||
FWidth := 12;
|
FWidth := 12;
|
||||||
FHeight := 9;
|
FHeight := 9;
|
||||||
|
|
||||||
FBackground.Style := fsNoFill;
|
// FBackground and FBorder already created by ancestor.
|
||||||
FBorder.Style := clsNoLine;
|
|
||||||
|
|
||||||
FPlotArea := TsChartFillElement.Create(self);
|
FPlotArea := TsChartFillElement.Create(self);
|
||||||
FFloor := TsChartFillElement.Create(self);
|
FFloor := TsChartFillElement.Create(self);
|
||||||
|
FFloor.Background.Style := fsNoFill;
|
||||||
|
|
||||||
FTitle := TsChartText.Create(self);
|
FTitle := TsChartText.Create(self);
|
||||||
FTitle.Font.Size := 14;
|
FTitle.Font.Size := 14;
|
||||||
|
@ -8,10 +8,16 @@ uses
|
|||||||
Classes, SysUtils, fpsTypes, fpsChart;
|
Classes, SysUtils, fpsTypes, fpsChart;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
TsChartStyleType = (cstBackground, cstWall, cstFloor);
|
||||||
|
|
||||||
TsChartStyle = class
|
TsChartStyle = class
|
||||||
|
private
|
||||||
|
FStyleType: TsChartStyleType;
|
||||||
public
|
public
|
||||||
|
constructor Create(AStyleType: TsChartStyleType); virtual;
|
||||||
procedure ApplyToChart(AChart: TsChart); virtual; abstract;
|
procedure ApplyToChart(AChart: TsChart); virtual; abstract;
|
||||||
procedure ExtractFromChart(AChart: TsChart); virtual; abstract;
|
procedure ExtractFromChart(AChart: TsChart); virtual; abstract;
|
||||||
|
property StyleType: TsChartStyleType read FStyleType;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TsChartBackgroundStyle = class(TsChartStyle)
|
TsChartBackgroundStyle = class(TsChartStyle)
|
||||||
@ -26,26 +32,66 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
TsChartStyleList = class(TFPList)
|
TsChartStyleList = class(TFPList)
|
||||||
|
protected
|
||||||
|
|
||||||
public
|
public
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
procedure AddChartBackgroundStyle(AChart: TsChart; AStyleType: TsChartStyleType);
|
||||||
procedure Clear;
|
procedure Clear;
|
||||||
function FindChartBackgroundStyle(AChart: TsChart): Integer;
|
function FindChartBackgroundStyle(AChart: TsChart; AStyleType: TsChartStyleType): Integer;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
{ TsChartStyle }
|
||||||
|
|
||||||
|
constructor TsChartStyle.Create(AStyleType: TsChartStyleType);
|
||||||
|
begin
|
||||||
|
FStyleType := AStyleType;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TsChartBackgroundstyle }
|
{ TsChartBackgroundstyle }
|
||||||
|
|
||||||
procedure TsChartBackgroundStyle.ApplyToChart(AChart: TsChart);
|
procedure TsChartBackgroundStyle.ApplyToChart(AChart: TsChart);
|
||||||
begin
|
begin
|
||||||
AChart.Background.FromRecord(FBackground);
|
case FStyleType of
|
||||||
AChart.Border.FromRecord(FBorder);
|
cstBackground:
|
||||||
|
begin
|
||||||
|
AChart.Background.FromRecord(FBackground);
|
||||||
|
AChart.Border.FromRecord(FBorder);
|
||||||
|
end;
|
||||||
|
cstWall:
|
||||||
|
begin
|
||||||
|
AChart.PlotArea.Background.FromRecord(FBackground);
|
||||||
|
AChart.PlotArea.Border.FromRecord(FBorder);
|
||||||
|
end;
|
||||||
|
cstFloor:
|
||||||
|
begin
|
||||||
|
AChart.Floor.Background.FromRecord(FBackGround);
|
||||||
|
AChart.Floor.Border.FromRecord(FBorder);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TsChartBackgroundStyle.ExtractFromChart(AChart: TsChart);
|
procedure TsChartBackgroundStyle.ExtractFromChart(AChart: TsChart);
|
||||||
begin
|
begin
|
||||||
FBackground := AChart.Background.ToRecord;
|
case FStyleType of
|
||||||
FBorder := AChart.Border.ToRecord;
|
cstBackground:
|
||||||
|
begin
|
||||||
|
FBackground := AChart.Background.ToRecord;
|
||||||
|
FBorder := AChart.Border.ToRecord;
|
||||||
|
end;
|
||||||
|
cstWall:
|
||||||
|
begin
|
||||||
|
FBackground := AChart.PlotArea.Background.ToRecord;
|
||||||
|
FBorder := AChart.PlotArea.Border.ToRecord;
|
||||||
|
end;
|
||||||
|
cstFloor:
|
||||||
|
begin
|
||||||
|
FBackground := AChart.Floor.Background.ToRecord;
|
||||||
|
FBorder := AChart.Floor.Border.ToRecord;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TsChartStyleList }
|
{ TsChartStyleList }
|
||||||
@ -56,6 +102,14 @@ begin
|
|||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ Adds the style of the specified type in the given chart as new style to the
|
||||||
|
style list. But only if the same style does not yet exist. }
|
||||||
|
procedure TsChartStyleList.AddChartBackgroundStyle(AChart: TsChart;
|
||||||
|
AStyleType: TsChartStyleType);
|
||||||
|
begin
|
||||||
|
FindChartBackgroundStyle(AChart, AStyleType);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TsChartStyleList.Clear;
|
procedure TsChartStyleList.Clear;
|
||||||
var
|
var
|
||||||
j: Integer;
|
j: Integer;
|
||||||
@ -67,25 +121,28 @@ end;
|
|||||||
|
|
||||||
{ Searches whether the background style of the specified chart is already in the
|
{ Searches whether the background style of the specified chart is already in the
|
||||||
list. If not, a new style is created and added.
|
list. If not, a new style is created and added.
|
||||||
|
The type of the requested background must be provided as parameter.
|
||||||
Returns the index of the style. }
|
Returns the index of the style. }
|
||||||
function TsChartStyleList.FindChartBackgroundStyle(AChart: TsChart): Integer;
|
function TsChartStyleList.FindChartBackgroundStyle(AChart: TsChart;
|
||||||
|
AStyleType: TsChartStyleType): Integer;
|
||||||
var
|
var
|
||||||
newStyle, style: TsChartBackgroundStyle;
|
newStyle, style: TsChartBackgroundStyle;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
Result := -1;
|
Result := -1;
|
||||||
newStyle := TsChartBackgroundStyle.Create;
|
newStyle := TsChartBackgroundStyle.Create(AStyleType);
|
||||||
newStyle.ExtractFromChart(AChart);
|
newStyle.ExtractFromChart(AChart);
|
||||||
for i := 0 to Count-1 do
|
for i := 0 to Count-1 do
|
||||||
begin
|
begin
|
||||||
if (TsChartStyle(Items[i]) is TsChartBackgroundStyle) then
|
if (TsChartStyle(Items[i]) is TsChartBackgroundStyle) and
|
||||||
|
(TsChartStyle(Items[i]).StyleType = AStyleType) then
|
||||||
begin
|
begin
|
||||||
style := TsChartBackgroundStyle(Items[i]);
|
style := TsChartBackgroundStyle(Items[i]);
|
||||||
if style.FBackground = newStyle.FBackground then
|
if (style.Background = newStyle.Background) then
|
||||||
begin
|
begin
|
||||||
Result := i;
|
Result := i;
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
if Result = -1 then
|
if Result = -1 then
|
||||||
|
@ -40,7 +40,7 @@ uses
|
|||||||
fpszipper,
|
fpszipper,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
fpstypes, fpsReaderWriter, fpsutils, fpsHeaderFooterParser,
|
fpstypes, fpsReaderWriter, fpsutils, fpsHeaderFooterParser,
|
||||||
fpsNumFormat, fpsxmlcommon, fpsPagelayout, fpsChart;
|
fpsNumFormat, fpsxmlcommon, fpsPagelayout, fpsChart, fpsChartStyles;
|
||||||
|
|
||||||
type
|
type
|
||||||
TDateModeODS=(
|
TDateModeODS=(
|
||||||
@ -286,9 +286,12 @@ type
|
|||||||
function WriteWordwrapStyleXMLAsString(const AFormat: TsCellFormat): String;
|
function WriteWordwrapStyleXMLAsString(const AFormat: TsCellFormat): String;
|
||||||
|
|
||||||
{ Chart support }
|
{ Chart support }
|
||||||
|
function GetChartBackgroundStyleAsXML(AChart: TsChart; AStyleIndex: Integer; AIndent: Integer): String;
|
||||||
|
|
||||||
procedure PrepareChartTable(AChart: TsChart; AWorksheet: TsBasicWorksheet);
|
procedure PrepareChartTable(AChart: TsChart; AWorksheet: TsBasicWorksheet);
|
||||||
procedure WriteChart(AStream: TStream; AChart: TsChart);
|
procedure WriteChart(AStream: TStream; AChart: TsChart);
|
||||||
procedure WriteChartAxis(AStream: TStream; AChart: TsChart; IsX, IsPrimary: Boolean; AIndent: Integer);
|
procedure WriteChartAxis(AStream: TStream; AChart: TsChart; IsX, IsPrimary: Boolean; AIndent: Integer);
|
||||||
|
procedure WriteChartBackground(AStream: TStream; AChart: TsChart; AIndent: Integer);
|
||||||
procedure WriteChartLegend(AStream: TStream; AChart: TsChart; AIndent: Integer);
|
procedure WriteChartLegend(AStream: TStream; AChart: TsChart; AIndent: Integer);
|
||||||
procedure WriteChartPlotArea(AStream: TStream; AChart: TsChart; AIndent: Integer);
|
procedure WriteChartPlotArea(AStream: TStream; AChart: TsChart; AIndent: Integer);
|
||||||
procedure WriteChartSeries(AStream: TStream; AChart: TsChart; ASeriesIndex: Integer; AIndent: Integer);
|
procedure WriteChartSeries(AStream: TStream; AChart: TsChart; ASeriesIndex: Integer; AIndent: Integer);
|
||||||
@ -376,7 +379,7 @@ uses
|
|||||||
StrUtils, Variants, LazFileUtils, URIParser, LazUTF8,
|
StrUtils, Variants, LazFileUtils, URIParser, LazUTF8,
|
||||||
{%H-}fpsPatches,
|
{%H-}fpsPatches,
|
||||||
fpsStrings, fpsStreams, fpsCrypto, fpsClasses, fpspreadsheet,
|
fpsStrings, fpsStreams, fpsCrypto, fpsClasses, fpspreadsheet,
|
||||||
fpsExprParser, fpsImages, fpsConditionalFormat, fpsChartStyles;
|
fpsExprParser, fpsImages, fpsConditionalFormat;
|
||||||
|
|
||||||
const
|
const
|
||||||
LE = LineEnding;
|
LE = LineEnding;
|
||||||
@ -5884,7 +5887,9 @@ begin
|
|||||||
for i := 0 to book.GetChartCount-1 do
|
for i := 0 to book.GetChartCount-1 do
|
||||||
begin
|
begin
|
||||||
chart := book.GetChartByIndex(i);
|
chart := book.GetChartByIndex(i);
|
||||||
styles.FindChartBackGroundStyle(chart);
|
styles.AddChartBackGroundStyle(chart, cstBackground);
|
||||||
|
styles.AddChartBackgroundStyle(chart, cstWall);
|
||||||
|
styles.AddChartBackgroundStyle(chart, cstFloor);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -6699,9 +6704,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TsSpreadOpenDocWriter.WriteChart(AStream: TStream; AChart: TsChart);
|
procedure TsSpreadOpenDocWriter.WriteChart(AStream: TStream; AChart: TsChart);
|
||||||
var
|
|
||||||
chartClass: String;
|
|
||||||
idx: Integer;
|
|
||||||
begin
|
begin
|
||||||
AppendToStream(AStream,
|
AppendToStream(AStream,
|
||||||
XML_HEADER + LE);
|
XML_HEADER + LE);
|
||||||
@ -6752,21 +6754,7 @@ begin
|
|||||||
' <office:chart>' + LE
|
' <office:chart>' + LE
|
||||||
);
|
);
|
||||||
|
|
||||||
chartClass := CHART_TYPE_NAMES[AChart.GetChartType];
|
WriteChartBackground(AStream, AChart, 8);
|
||||||
if chartClass <> '' then
|
|
||||||
chartClass := ' chart:class="chart:' + chartClass + '"';
|
|
||||||
|
|
||||||
idx := TsChartStyleList(FChartStyleList).FindChartBackgroundStyle(AChart);
|
|
||||||
AppendToStream(AStream, Format(
|
|
||||||
' <chart:chart svg:width="%.3fmm" svg:height="%.3fmm" xlink:href=".." ' + LE +
|
|
||||||
' xlink:type="simple"' + chartClass + ' chart:style-name="ch%d"> ' + LE,
|
|
||||||
[
|
|
||||||
AChart.Width, // Width, Height are in mm
|
|
||||||
AChart.Height,
|
|
||||||
idx + 1
|
|
||||||
], FPointSeparatorSettings
|
|
||||||
));
|
|
||||||
|
|
||||||
WriteChartTitle(AStream, AChart, false, 8); // Title
|
WriteChartTitle(AStream, AChart, false, 8); // Title
|
||||||
WriteChartTitle(AStream, AChart, true, 8); // Subtitle
|
WriteChartTitle(AStream, AChart, true, 8); // Subtitle
|
||||||
WriteChartLegend(AStream, AChart, 8);
|
WriteChartLegend(AStream, AChart, 8);
|
||||||
@ -6869,6 +6857,31 @@ begin
|
|||||||
);
|
);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ Writes the chart's background to the xml stream }
|
||||||
|
procedure TsSpreadOpenDocWriter.WriteChartBackground(AStream: TStream;
|
||||||
|
AChart: TsChart; AIndent: Integer);
|
||||||
|
var
|
||||||
|
ind: String;
|
||||||
|
idx: Integer;
|
||||||
|
chartClass: String;
|
||||||
|
begin
|
||||||
|
chartClass := CHART_TYPE_NAMES[AChart.GetChartType];
|
||||||
|
if chartClass <> '' then
|
||||||
|
chartClass := ' chart:class="chart:' + chartClass + '"';
|
||||||
|
|
||||||
|
idx := TsChartStyleList(FChartStyleList).FindChartBackgroundStyle(AChart, cstBackground);
|
||||||
|
|
||||||
|
AppendToStream(AStream, Format(
|
||||||
|
' <chart:chart svg:width="%.3fmm" svg:height="%.3fmm" xlink:href=".." ' + LE +
|
||||||
|
' xlink:type="simple"' + chartClass + ' chart:style-name="ch%d"> ' + LE,
|
||||||
|
[
|
||||||
|
AChart.Width, // Width, Height are in mm
|
||||||
|
AChart.Height,
|
||||||
|
idx + 1
|
||||||
|
], FPointSeparatorSettings
|
||||||
|
));
|
||||||
|
end;
|
||||||
|
|
||||||
{ Writes the chart's legend to the xml stream }
|
{ Writes the chart's legend to the xml stream }
|
||||||
procedure TsSpreadOpenDocWriter.WriteChartLegend(AStream: TStream; AChart: TsChart;
|
procedure TsSpreadOpenDocWriter.WriteChartLegend(AStream: TStream; AChart: TsChart;
|
||||||
AIndent: Integer);
|
AIndent: Integer);
|
||||||
@ -6894,8 +6907,7 @@ var
|
|||||||
ind: String;
|
ind: String;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
plotAreaStyleID: Integer = 5;
|
plotAreaStyleID: Integer = 5;
|
||||||
wallStyleID: Integer = 22; // usually second to last of style list
|
wallStyleIdx, floorStyleIdx: Integer;
|
||||||
floorstyleID: Integer = 23; // usually last of style list
|
|
||||||
begin
|
begin
|
||||||
ind := DupeString(' ', AIndent);
|
ind := DupeString(' ', AIndent);
|
||||||
AppendToStream(AStream, Format(
|
AppendToStream(AStream, Format(
|
||||||
@ -6910,11 +6922,14 @@ begin
|
|||||||
for i := 0 to AChart.Series.Count-1 do
|
for i := 0 to AChart.Series.Count-1 do
|
||||||
WriteChartSeries(AStream, AChart, i, AIndent + 2);
|
WriteChartSeries(AStream, AChart, i, AIndent + 2);
|
||||||
|
|
||||||
|
wallStyleIdx := TsChartStyleList(FChartStyleList).FindChartBackgroundStyle(AChart, cstWall);
|
||||||
|
floorStyleIdx := TsChartStyleList(FChartStyleList).FindChartBackgroundStyle(AChart, cstFloor);
|
||||||
|
|
||||||
AppendToStream(AStream, Format(
|
AppendToStream(AStream, Format(
|
||||||
ind + ' <chart:wall chart:style-name="ch%d"/>' + LE +
|
ind + ' <chart:wall chart:style-name="ch%d"/>' + LE +
|
||||||
ind + ' <chart:floor chart:style-name="ch%d"/>' + LE +
|
ind + ' <chart:floor chart:style-name="ch%d"/>' + LE +
|
||||||
ind + '</chart:plot-area>' + LE,
|
ind + '</chart:plot-area>' + LE,
|
||||||
[ wallStyleID, floorStyleID ]
|
[ wallStyleIdx + 1, floorStyleIdx + 1 ]
|
||||||
));
|
));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -6965,51 +6980,61 @@ begin
|
|||||||
);
|
);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TsSpreadOpenDocWriter.GetChartBackgroundStyleAsXML(
|
||||||
|
AChart: TsChart; AStyleIndex: Integer; AIndent: Integer): String;
|
||||||
|
var
|
||||||
|
ind: String;
|
||||||
|
idx: Integer;
|
||||||
|
style: TsChartBackgroundStyle;
|
||||||
|
s, drawStroke, strokeColor, drawFill, drawFillColor: String;
|
||||||
|
begin
|
||||||
|
style := TsChartBackgroundStyle(FChartStyleList[AStyleIndex]);
|
||||||
|
|
||||||
|
case style.Border.Style of
|
||||||
|
clsNoLine: s := 'none';
|
||||||
|
clsSolid: s := 'solid';
|
||||||
|
else s := 'none'; // FIXME: get correct line styles from chart
|
||||||
|
end;
|
||||||
|
drawStroke := 'draw:stroke="' + s + '" ';
|
||||||
|
|
||||||
|
if style.Border.Style <> clsNoLine then
|
||||||
|
strokeColor := 'svg:stroke-color="' + ColorToHTMLColorStr(style.Border.Color) + '" '
|
||||||
|
else
|
||||||
|
strokeColor := '';
|
||||||
|
|
||||||
|
if style.Background.Style = fsSolidFill then
|
||||||
|
begin
|
||||||
|
drawFill := 'draw:fill="solid" ';
|
||||||
|
drawFillColor := 'draw:fill-color="' + ColorToHTMLColorStr(style.Background.FGColor) + '" ';
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
drawFill := 'draw:fill="none" ';
|
||||||
|
drawFillColor := '';
|
||||||
|
end;
|
||||||
|
// Other draw:fill options, not supported so far: gradient, hatch, bitmap
|
||||||
|
|
||||||
|
ind := DupeString(' ', AIndent);
|
||||||
|
Result := Format(
|
||||||
|
ind + '<style:style style:name="ch%d" style:family="chart">' + LE +
|
||||||
|
ind + ' <style:graphic-properties %s%s%s%s />' + LE +
|
||||||
|
ind + '</style:style>' + LE,
|
||||||
|
[ AStyleIndex+1, drawStroke, strokeColor, drawFill, drawFillColor ]
|
||||||
|
);
|
||||||
|
end;
|
||||||
|
|
||||||
{ To do: The list of styles must be updated to the real chart element settings. }
|
{ To do: The list of styles must be updated to the real chart element settings. }
|
||||||
procedure TsSpreadOpenDocWriter.WriteChartStyles(AStream: TStream;
|
procedure TsSpreadOpenDocWriter.WriteChartStyles(AStream: TStream;
|
||||||
AChart: TsChart; AIndent: Integer);
|
AChart: TsChart; AIndent: Integer);
|
||||||
|
|
||||||
function GetChartBackgroundStyleXML(AIndent: Integer): String;
|
|
||||||
var
|
|
||||||
ind: String;
|
|
||||||
idx: Integer;
|
|
||||||
style: TsChartBackgroundStyle;
|
|
||||||
s, drawStroke, strokeColor, drawFillColor: String;
|
|
||||||
begin
|
|
||||||
idx := TsChartStyleList(FChartStyleList).FindChartBackgroundStyle(AChart);
|
|
||||||
if idx = -1 then
|
|
||||||
raise Exception.Create('Chart background style not found.');
|
|
||||||
style := TsChartBackgroundStyle(FChartStyleList[idx]);
|
|
||||||
|
|
||||||
case style.Border.Style of
|
|
||||||
clsNoLine: s := 'none';
|
|
||||||
clsSolid: s := 'solid';
|
|
||||||
else s := 'none'; // FIXME: get correct line styles from chart
|
|
||||||
end;
|
|
||||||
drawStroke := 'draw:stroke="' + s + '" ';
|
|
||||||
|
|
||||||
if style.Border.Style <> clsNoLine then
|
|
||||||
strokeColor := 'svg:stroke-color="' + ColorToHTMLColorStr(style.Border.Color) + '" '
|
|
||||||
else
|
|
||||||
strokeColor := '';
|
|
||||||
|
|
||||||
if style.Background.Style = fsSolidFill then
|
|
||||||
drawFillColor := 'draw:fill-color="' + ColorToHTMLColorStr(style.Background.FGColor) + '" '
|
|
||||||
else
|
|
||||||
drawFillColor := '';
|
|
||||||
|
|
||||||
ind := DupeString(' ', AIndent);
|
|
||||||
Result := Format(
|
|
||||||
ind + '<style:style style:name="ch%d" style:family="chart">' + LE +
|
|
||||||
ind + ' <style:graphic-properties %s%s%s />' + LE +
|
|
||||||
ind + '</style:style>' + LE,
|
|
||||||
[ idx+1, drawStroke, strokeColor, drawFillColor ]
|
|
||||||
);
|
|
||||||
end;
|
|
||||||
|
|
||||||
var
|
var
|
||||||
ind: String;
|
ind: String;
|
||||||
|
backGrStyleIdx: Integer;
|
||||||
|
wallStyleIdx: Integer;
|
||||||
|
floorStyleIdx: Integer;
|
||||||
begin
|
begin
|
||||||
|
backGrStyleIdx := TsChartStyleList(FChartStyleList).FindChartBackgroundStyle(AChart, cstBackground);
|
||||||
|
wallStyleIdx := TsChartStyleList(FChartStyleList).FindChartBackgroundStyle(AChart, cstWall);
|
||||||
|
floorStyleIdx := TsChartStyleList(FChartStyleList).FindChartBackgroundStyle(AChart, cstFloor);
|
||||||
|
|
||||||
ind := DupeString(' ', AIndent);
|
ind := DupeString(' ', AIndent);
|
||||||
|
|
||||||
AppendToStream(AStream,
|
AppendToStream(AStream,
|
||||||
@ -7018,21 +7043,21 @@ begin
|
|||||||
ind + ' <number:number number:min-integer-digits="1"/>' + LE +
|
ind + ' <number:number number:min-integer-digits="1"/>' + LE +
|
||||||
ind + ' </number:number-style>' + LE +
|
ind + ' </number:number-style>' + LE +
|
||||||
|
|
||||||
// ch1: style for <chart:chart> element
|
// style for <chart:chart> element
|
||||||
GetChartBackgroundStyleXML(AIndent + 2) +
|
GetChartBackgroundStyleAsXML(AChart, backGrStyleIdx, AIndent + 2) +
|
||||||
{
|
{
|
||||||
ind + ' <style:style style:name="ch1" style:family="chart">' + LE +
|
ind + ' <style:style style:name="ch1" style:family="chart">' + LE +
|
||||||
ind + ' <style:graphic-properties draw:stroke="solid"/>' + LE + // '
|
ind + ' <style:graphic-properties draw:stroke="solid"/>' + LE + // '
|
||||||
ind + ' </style:style>' + LE +
|
ind + ' </style:style>' + LE +
|
||||||
}
|
}
|
||||||
// ch2: style for <chart:title> element
|
// ch2: style for <chart:title> element
|
||||||
ind + ' <style:style style:name="ch2" style:family="chart">' + LE +
|
ind + ' <style:style style:name="ch200" style:family="chart">' + LE +
|
||||||
ind + ' <style:chart-properties chart:auto-position="true" style:rotation-angle="0"/>' + LE +
|
ind + ' <style:chart-properties chart:auto-position="true" style:rotation-angle="0"/>' + LE +
|
||||||
ind + ' <style:text-properties fo:font-size="13pt" style:font-size-asian="13pt" style:font-size-complex="13pt"/>' + LE +
|
ind + ' <style:text-properties fo:font-size="13pt" style:font-size-asian="13pt" style:font-size-complex="13pt"/>' + LE +
|
||||||
ind + ' </style:style>' + LE +
|
ind + ' </style:style>' + LE +
|
||||||
|
|
||||||
// ch3: style for <chart:subtitle element
|
// ch3: style for <chart:subtitle element
|
||||||
ind + ' <style:style style:name="ch3" style:family="chart">' + LE +
|
ind + ' <style:style style:name="ch300" style:family="chart">' + LE +
|
||||||
ind + ' <style:chart-properties chart:auto-position="true" style:rotation-angle="0"/>' + LE +
|
ind + ' <style:chart-properties chart:auto-position="true" style:rotation-angle="0"/>' + LE +
|
||||||
ind + ' <style:text-properties fo:font-size="11pt" style:font-size-asian="11pt" style:font-size-complex="11pt"/>' + LE +
|
ind + ' <style:text-properties fo:font-size="11pt" style:font-size-asian="11pt" style:font-size-complex="11pt"/>' + LE +
|
||||||
ind + ' </style:style>' + LE +
|
ind + ' </style:style>' + LE +
|
||||||
@ -7203,7 +7228,10 @@ begin
|
|||||||
ind + ' <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>' + LE +
|
ind + ' <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>' + LE +
|
||||||
ind + ' </style:style>' + LE +
|
ind + ' </style:style>' + LE +
|
||||||
|
|
||||||
// next to last: style for wall
|
GetChartBackgroundStyleAsXML(AChart, wallStyleIdx, AIndent + 2) +
|
||||||
|
GetChartBackgroundStyleAsXML(AChart, floorStyleIdx, AIndent + 2) +
|
||||||
|
{
|
||||||
|
// next to last: style for wall
|
||||||
ind + ' <style:style style:name="ch22" style:family="chart">' + LE +
|
ind + ' <style:style style:name="ch22" style:family="chart">' + LE +
|
||||||
ind + ' <style:graphic-properties draw:stroke="solid" svg:stroke-color="#b3b3b3" draw:fill="none" draw:fill-color="#e6e6e6"/>' + LE +
|
ind + ' <style:graphic-properties draw:stroke="solid" svg:stroke-color="#b3b3b3" draw:fill="none" draw:fill-color="#e6e6e6"/>' + LE +
|
||||||
ind + ' </style:style>' + LE +
|
ind + ' </style:style>' + LE +
|
||||||
@ -7212,7 +7240,7 @@ begin
|
|||||||
ind + ' <style:style style:name="ch23" style:family="chart">' + LE +
|
ind + ' <style:style style:name="ch23" style:family="chart">' + LE +
|
||||||
ind + ' <style:graphic-properties svg:stroke-color="#b3b3b3" draw:fill-color="#cccccc"/>' + LE +
|
ind + ' <style:graphic-properties svg:stroke-color="#b3b3b3" draw:fill-color="#cccccc"/>' + LE +
|
||||||
ind + ' </style:style>' + LE +
|
ind + ' </style:style>' + LE +
|
||||||
|
}
|
||||||
ind + '</office:automatic-styles>' + LE
|
ind + '</office:automatic-styles>' + LE
|
||||||
);
|
);
|
||||||
end;
|
end;
|
||||||
@ -7551,7 +7579,7 @@ begin
|
|||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
elementName := 'title';
|
elementName := 'title';
|
||||||
titleStyleID := 2;
|
titleStyleID := 200;
|
||||||
cap := AChart.Title.Caption;
|
cap := AChart.Title.Caption;
|
||||||
end;
|
end;
|
||||||
AppendToStream(AStream, Format(
|
AppendToStream(AStream, Format(
|
||||||
|
Reference in New Issue
Block a user