fpspreadsheet: xlsx chart writer supports line series.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9243 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
2dd2f58400
commit
3df923204b
@ -0,0 +1,68 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<CONFIG>
|
||||||
|
<ProjectOptions>
|
||||||
|
<Version Value="12"/>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<General>
|
||||||
|
<Flags>
|
||||||
|
<MainUnitHasCreateFormStatements Value="False"/>
|
||||||
|
<MainUnitHasTitleStatement Value="False"/>
|
||||||
|
<MainUnitHasScaledStatement Value="False"/>
|
||||||
|
</Flags>
|
||||||
|
<SessionStorage Value="InProjectDir"/>
|
||||||
|
<Title Value="linechart_write_demo"/>
|
||||||
|
<UseAppBundle Value="False"/>
|
||||||
|
<ResourceType Value="res"/>
|
||||||
|
</General>
|
||||||
|
<BuildModes>
|
||||||
|
<Item Name="Default" Default="True"/>
|
||||||
|
</BuildModes>
|
||||||
|
<PublishOptions>
|
||||||
|
<Version Value="2"/>
|
||||||
|
<UseFileFilters Value="True"/>
|
||||||
|
</PublishOptions>
|
||||||
|
<RunParams>
|
||||||
|
<FormatVersion Value="2"/>
|
||||||
|
</RunParams>
|
||||||
|
<RequiredPackages>
|
||||||
|
<Item>
|
||||||
|
<PackageName Value="laz_fpspreadsheet"/>
|
||||||
|
</Item>
|
||||||
|
</RequiredPackages>
|
||||||
|
<Units>
|
||||||
|
<Unit>
|
||||||
|
<Filename Value="linechart_write_demo.lpr"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
</Unit>
|
||||||
|
</Units>
|
||||||
|
</ProjectOptions>
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="11"/>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<Target>
|
||||||
|
<Filename Value="linechart_write_demo"/>
|
||||||
|
</Target>
|
||||||
|
<SearchPaths>
|
||||||
|
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||||
|
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||||
|
</SearchPaths>
|
||||||
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<DebugInfoType Value="dsDwarf3"/>
|
||||||
|
</Debugging>
|
||||||
|
</Linking>
|
||||||
|
</CompilerOptions>
|
||||||
|
<Debugging>
|
||||||
|
<Exceptions>
|
||||||
|
<Item>
|
||||||
|
<Name Value="EAbort"/>
|
||||||
|
</Item>
|
||||||
|
<Item>
|
||||||
|
<Name Value="ECodetoolError"/>
|
||||||
|
</Item>
|
||||||
|
<Item>
|
||||||
|
<Name Value="EFOpenError"/>
|
||||||
|
</Item>
|
||||||
|
</Exceptions>
|
||||||
|
</Debugging>
|
||||||
|
</CONFIG>
|
||||||
@ -0,0 +1,128 @@
|
|||||||
|
program linechart_write_demo;
|
||||||
|
|
||||||
|
{.$DEFINE DARK_MODE}
|
||||||
|
|
||||||
|
uses
|
||||||
|
SysUtils,
|
||||||
|
fpspreadsheet, fpstypes, fpsUtils, fpschart, xlsxooxml, fpsopendocument;
|
||||||
|
|
||||||
|
procedure WriteHelp;
|
||||||
|
begin
|
||||||
|
WriteLn('SYNTAX: linechart_write_demo [rotated] [normal|stacked|percent-stacked] ');
|
||||||
|
WriteLn(' (no argument) ..... normal orientation (x horizontal)');
|
||||||
|
WriteLn(' rotated ........... axes rotated (x vertical)');
|
||||||
|
WriteLn(' normal ............ back-to-bottom areas (default)');
|
||||||
|
WriteLn(' stacked ........... stacked areas');
|
||||||
|
WriteLn(' percent-stacked ... stacked by percentage');
|
||||||
|
Halt;
|
||||||
|
end;
|
||||||
|
|
||||||
|
const
|
||||||
|
FILE_NAME = 'line';
|
||||||
|
var
|
||||||
|
book: TsWorkbook;
|
||||||
|
sheet: TsWorksheet;
|
||||||
|
ch: TsChart;
|
||||||
|
ser: TsLineSeries;
|
||||||
|
dir, fn: String;
|
||||||
|
stackMode: TsChartStackMode = csmDefault;
|
||||||
|
rotated: Boolean = false;
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
fn := FILE_NAME;
|
||||||
|
|
||||||
|
for i := 1 to ParamCount do
|
||||||
|
case lowercase(ParamStr(i)) of
|
||||||
|
'rotated':
|
||||||
|
rotated := true;
|
||||||
|
'normal' ,'default':
|
||||||
|
stackMode := csmDefault;
|
||||||
|
'stacked':
|
||||||
|
stackMode := csmStacked;
|
||||||
|
'percent-stacked', 'stacked-percent', 'percentstacked', 'stackedpercent', 'percent', 'percentage':
|
||||||
|
stackMode := csmStackedPercentage;
|
||||||
|
else
|
||||||
|
WriteHelp;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if rotated then
|
||||||
|
fn := fn + '-rotated';
|
||||||
|
case stackMode of
|
||||||
|
csmDefault: ;
|
||||||
|
csmStacked: fn := fn + '-stacked';
|
||||||
|
csmStackedPercentage: fn := fn + '-stackedpercent';
|
||||||
|
end;
|
||||||
|
|
||||||
|
dir := ExtractFilePath(ParamStr(0)) + 'files/';
|
||||||
|
ForceDirectories(dir);
|
||||||
|
|
||||||
|
book := TsWorkbook.Create;
|
||||||
|
try
|
||||||
|
// worksheet
|
||||||
|
sheet := book.AddWorksheet('line_series');
|
||||||
|
|
||||||
|
// Enter data
|
||||||
|
sheet.WriteText( 0, 0, 'School Grades');
|
||||||
|
sheet.WriteFont( 0, 0, '', 12, [fssBold], scBlack);
|
||||||
|
sheet.WriteText( 2, 0, ''); sheet.WriteText ( 2, 1, 'Student 1'); sheet.WriteText ( 2, 2, 'Student 2');
|
||||||
|
sheet.WriteText( 3, 0, 'Biology'); sheet.WriteNumber( 3, 1, 12); sheet.WriteNumber( 3, 2, 15);
|
||||||
|
sheet.WriteText( 4, 0, 'History'); sheet.WriteNumber( 4, 1, 11); sheet.WriteNumber( 4, 2, 13);
|
||||||
|
sheet.WriteText( 5, 0, 'French'); sheet.WriteNumber( 5, 1, 16); sheet.WriteNumber( 5, 2, 11);
|
||||||
|
sheet.WriteText( 6, 0, 'English'); sheet.WriteNumber( 6, 1, 18); sheet.WriteNumber( 6, 2, 11);
|
||||||
|
sheet.WriteText( 7, 0, 'Sports'); sheet.WriteNumber( 7, 1, 16); sheet.WriteNumber( 7, 2, 7);
|
||||||
|
sheet.WriteText( 8, 0, 'Maths'); sheet.WriteNumber( 8, 1, 10); sheet.WriteNumber( 8, 2, 17);
|
||||||
|
sheet.WriteText( 9, 0, 'Physics'); sheet.WriteNumber( 9, 1, 12); sheet.WriteNumber( 9, 2, 19);
|
||||||
|
sheet.WriteText(10, 0, 'Computer'); sheet.WriteNumber(10, 1, 16); sheet.WriteNumber(10, 2, 18);
|
||||||
|
|
||||||
|
// Create chart: left/top in cell D4, 160 mm x 100 mm
|
||||||
|
ch := book.AddChart(sheet, 2, 3, 160, 100);
|
||||||
|
|
||||||
|
// Chart properties
|
||||||
|
ch.Border.Style := clsNoLine;
|
||||||
|
ch.Title.Caption := 'School Grades';
|
||||||
|
ch.Title.Font.Style := [fssBold];
|
||||||
|
ch.Title.Font.Color := scBlue;
|
||||||
|
ch.Legend.Border.Style := clsNoLine;
|
||||||
|
ch.XAxis.Title.Caption := '';
|
||||||
|
ch.YAxis.Title.Caption := 'Grade points';
|
||||||
|
ch.YAxis.AxisLine.Color := scSilver;
|
||||||
|
ch.YAxis.MajorTicks := [];
|
||||||
|
ch.RotatedAxes := rotated;
|
||||||
|
ch.StackMode := stackMode;
|
||||||
|
|
||||||
|
// Add 1st line series ("Student 1")
|
||||||
|
ser := TsLineSeries.Create(ch);
|
||||||
|
ser.SetTitleAddr(2, 1); // series 1 title in cell B3
|
||||||
|
ser.SetLabelRange(3, 0, 10, 0); // series 1 x labels in A4:A11
|
||||||
|
ser.SetYRange(3, 1, 10, 1); // series 1 y values in B4:B11
|
||||||
|
ser.Line.Color := scRed;
|
||||||
|
ser.ShowSymbols := true;
|
||||||
|
ser.SymbolFill.Color := scRed;
|
||||||
|
ser.SymbolFill.Style := cfsSolid;
|
||||||
|
ser.SymbolBorder.Color := scBlack;
|
||||||
|
ser.Smooth := true;
|
||||||
|
// ser.GroupIndex := -1;
|
||||||
|
|
||||||
|
// Add 2nd line series ("Student 2")
|
||||||
|
ser := TsLineSeries.Create(ch);
|
||||||
|
ser.SetTitleAddr(2, 2); // series 2 title in cell C3
|
||||||
|
ser.SetLabelRange(3, 0, 10, 0); // series 2 x labels in A4:A11
|
||||||
|
ser.SetYRange(3, 2, 10, 2); // series 2 y values in C4:C11
|
||||||
|
ser.Line.Color := scBlue;
|
||||||
|
ser.SymbolFill.Color := scBlue;
|
||||||
|
ser.SymbolFill.Style := cfsSolid;
|
||||||
|
ser.SymbolBorder.Color := scBlack;
|
||||||
|
//ser.Smooth := true;
|
||||||
|
ser.ShowSymbols := true;
|
||||||
|
// ser.GroupIndex := -1;
|
||||||
|
|
||||||
|
book.WriteToFile(dir + fn + '.xlsx', true);
|
||||||
|
WriteLn('... ', fn + '.xlsx');
|
||||||
|
|
||||||
|
book.WriteToFile(dir + fn + '.ods', true);
|
||||||
|
WriteLn('... ', fn + '.ods');
|
||||||
|
finally
|
||||||
|
book.Free;
|
||||||
|
end;
|
||||||
|
end.
|
||||||
|
|
||||||
@ -20,13 +20,21 @@ barchart_write_demo horiz stacked
|
|||||||
barchart_write_demo vert percentage
|
barchart_write_demo vert percentage
|
||||||
barchart_write_demo horiz percentage
|
barchart_write_demo horiz percentage
|
||||||
echo.
|
echo.
|
||||||
echoe BAR SERIES WITH TWO AXES
|
echo BAR SERIES WITH TWO AXES
|
||||||
barchart_2axes_write_demo
|
barchart_2axes_write_demo
|
||||||
barchart_2axes_write_demo rotated
|
barchart_2axes_write_demo rotated
|
||||||
echo.
|
echo.
|
||||||
echo BUBBLE SERIES
|
echo BUBBLE SERIES
|
||||||
bubblechart_write_demo
|
bubblechart_write_demo
|
||||||
echo.
|
echo.
|
||||||
|
echo LINE SERIES
|
||||||
|
linechart_write_demo
|
||||||
|
linechart_write_demo stacked
|
||||||
|
linechart_write_demo percentage
|
||||||
|
linechart_write_demo rotated
|
||||||
|
linechart_write_demo stacked rotated
|
||||||
|
linechart_write_demo percentage rotated
|
||||||
|
echo.
|
||||||
echo PIE SERIES
|
echo PIE SERIES
|
||||||
piechart_write_demo
|
piechart_write_demo
|
||||||
piechart_write_demo ring
|
piechart_write_demo ring
|
||||||
|
|||||||
@ -22,6 +22,11 @@
|
|||||||
<Mode Name="Default"/>
|
<Mode Name="Default"/>
|
||||||
</BuildModes>
|
</BuildModes>
|
||||||
</Target>
|
</Target>
|
||||||
|
<Target FileName="linechart_write_demo.lpi">
|
||||||
|
<BuildModes>
|
||||||
|
<Mode Name="Default"/>
|
||||||
|
</BuildModes>
|
||||||
|
</Target>
|
||||||
<Target FileName="piechart_write_demo.lpi">
|
<Target FileName="piechart_write_demo.lpi">
|
||||||
<BuildModes>
|
<BuildModes>
|
||||||
<Mode Name="Default"/>
|
<Mode Name="Default"/>
|
||||||
|
|||||||
@ -177,6 +177,7 @@ type
|
|||||||
TsChartFillStyle = (cfsNoFill, cfsSolid, cfsGradient, cfsHatched, cfsSolidHatched, cfsImage);
|
TsChartFillStyle = (cfsNoFill, cfsSolid, cfsGradient, cfsHatched, cfsSolidHatched, cfsImage);
|
||||||
|
|
||||||
TsChartFill = class
|
TsChartFill = class
|
||||||
|
public
|
||||||
Style: TsChartFillStyle;
|
Style: TsChartFillStyle;
|
||||||
Color: TsColor;
|
Color: TsColor;
|
||||||
Gradient: Integer; // Index into chart's Gradients list
|
Gradient: Integer; // Index into chart's Gradients list
|
||||||
@ -621,8 +622,15 @@ type
|
|||||||
cssDash, cssDot
|
cssDash, cssDot
|
||||||
);
|
);
|
||||||
|
|
||||||
|
TsChartInterpolation = (
|
||||||
|
ciLinear,
|
||||||
|
ciCubicSpline, ciBSpline,
|
||||||
|
ciStepStart, ciStepEnd, ciStepCenterX, ciStepCenterY
|
||||||
|
);
|
||||||
|
|
||||||
TsCustomLineSeries = class(TsChartSeries)
|
TsCustomLineSeries = class(TsChartSeries)
|
||||||
private
|
private
|
||||||
|
FInterpolation: TsChartInterpolation;
|
||||||
FSymbol: TsChartSeriesSymbol;
|
FSymbol: TsChartSeriesSymbol;
|
||||||
FSymbolHeight: Double; // in mm
|
FSymbolHeight: Double; // in mm
|
||||||
FSymbolWidth: Double; // in mm
|
FSymbolWidth: Double; // in mm
|
||||||
@ -630,7 +638,11 @@ type
|
|||||||
FShowSymbols: Boolean;
|
FShowSymbols: Boolean;
|
||||||
FSymbolBorder: TsChartLine;
|
FSymbolBorder: TsChartLine;
|
||||||
FSymbolFill: TsChartFill;
|
FSymbolFill: TsChartFill;
|
||||||
|
function GetSmooth: Boolean;
|
||||||
|
procedure SetSmooth(AValue: Boolean);
|
||||||
protected
|
protected
|
||||||
|
property Interpolation: TsChartInterpolation read FInterpolation write FInterpolation;
|
||||||
|
property Smooth: Boolean read GetSmooth write SetSmooth;
|
||||||
property Symbol: TsChartSeriesSymbol read FSymbol write FSymbol;
|
property Symbol: TsChartSeriesSymbol read FSymbol write FSymbol;
|
||||||
property SymbolBorder: TsChartLine read FSymbolBorder write FSymbolBorder;
|
property SymbolBorder: TsChartLine read FSymbolBorder write FSymbolBorder;
|
||||||
property SymbolFill: TsChartFill read FSymbolFill write FSymbolFill;
|
property SymbolFill: TsChartFill read FSymbolFill write FSymbolFill;
|
||||||
@ -645,6 +657,9 @@ type
|
|||||||
|
|
||||||
TsLineSeries = class(TsCustomLineSeries)
|
TsLineSeries = class(TsCustomLineSeries)
|
||||||
public
|
public
|
||||||
|
constructor Create(AChart: TsChart); override;
|
||||||
|
property Interpolation;
|
||||||
|
property Smooth;
|
||||||
property Symbol;
|
property Symbol;
|
||||||
property SymbolBorder;
|
property SymbolBorder;
|
||||||
property SymbolFill;
|
property SymbolFill;
|
||||||
@ -691,6 +706,8 @@ type
|
|||||||
|
|
||||||
TsScatterSeries = class(TsCustomScatterSeries)
|
TsScatterSeries = class(TsCustomScatterSeries)
|
||||||
public
|
public
|
||||||
|
property Interpolation;
|
||||||
|
property Smooth;
|
||||||
property Symbol;
|
property Symbol;
|
||||||
property SymbolBorder;
|
property SymbolBorder;
|
||||||
property SymbolFill;
|
property SymbolFill;
|
||||||
@ -761,11 +778,6 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
TsChartStackMode = (csmDefault, csmStacked, csmStackedPercentage);
|
TsChartStackMode = (csmDefault, csmStacked, csmStackedPercentage);
|
||||||
TsChartInterpolation = (
|
|
||||||
ciLinear,
|
|
||||||
ciCubicSpline, ciBSpline,
|
|
||||||
ciStepStart, ciStepEnd, ciStepCenterX, ciStepCenterY
|
|
||||||
);
|
|
||||||
|
|
||||||
TsChart = class(TsChartFillElement)
|
TsChart = class(TsChartFillElement)
|
||||||
private
|
private
|
||||||
@ -2550,6 +2562,30 @@ begin
|
|||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TsCustomLineSeries.GetSmooth: Boolean;
|
||||||
|
begin
|
||||||
|
Result := FInterpolation in [ciBSpline, ciCubicSpline];
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TsCustomLineSeries.SetSmooth(AValue: Boolean);
|
||||||
|
begin
|
||||||
|
if AValue then
|
||||||
|
begin
|
||||||
|
if not (FInterpolation in [ciBSpline, ciCubicSpline]) then
|
||||||
|
FInterpolation := ciCubicSpline;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
if (FInterpolation in [ciBSpline, ciCubicSpline]) then
|
||||||
|
FInterpolation := ciLinear;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TsLineSeries }
|
||||||
|
constructor TsLineSeries.Create(AChart: TsChart);
|
||||||
|
begin
|
||||||
|
inherited Create(AChart);
|
||||||
|
FGroupIndex := 0;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TsPieSeries }
|
{ TsPieSeries }
|
||||||
constructor TsPieSeries.Create(AChart: TsChart);
|
constructor TsPieSeries.Create(AChart: TsChart);
|
||||||
|
|||||||
@ -173,7 +173,10 @@ uses
|
|||||||
type
|
type
|
||||||
TAxisKind = 3..6;
|
TAxisKind = 3..6;
|
||||||
|
|
||||||
TsOpenedCustomLineSeries = class(TsCustomLineSeries);
|
TsOpenedCustomLineSeries = class(TsCustomLineSeries)
|
||||||
|
public
|
||||||
|
property Interpolation;
|
||||||
|
end;
|
||||||
|
|
||||||
TsOpenedTrendlineSeries = class(TsChartSeries)
|
TsOpenedTrendlineSeries = class(TsChartSeries)
|
||||||
public
|
public
|
||||||
@ -2603,6 +2606,7 @@ function TsSpreadOpenDocChartWriter.GetChartPlotAreaStyleAsXML(AChart: TsChart;
|
|||||||
AIndent, AStyleID: Integer): String;
|
AIndent, AStyleID: Integer): String;
|
||||||
var
|
var
|
||||||
indent: String;
|
indent: String;
|
||||||
|
interpolation: TsChartInterpolation;
|
||||||
interpolationStr: String = '';
|
interpolationStr: String = '';
|
||||||
verticalStr: String = '';
|
verticalStr: String = '';
|
||||||
stackModeStr: String = '';
|
stackModeStr: String = '';
|
||||||
@ -2625,8 +2629,15 @@ begin
|
|||||||
if (AChart.Series.Count > 0) and (AChart.Series[0] is TsPieSeries) then
|
if (AChart.Series.Count > 0) and (AChart.Series[0] is TsPieSeries) then
|
||||||
startAngleStr := Format('chart:angle-offset="%d" ', [TsPieSeries(AChart.Series[0]).StartAngle]);
|
startAngleStr := Format('chart:angle-offset="%d" ', [TsPieSeries(AChart.Series[0]).StartAngle]);
|
||||||
|
|
||||||
case AChart.Interpolation of
|
// In FPSpreadsheet individual series can be "smooth", in Calc only all.
|
||||||
ciLinear: ;
|
// As a compromise, when we find at least one smooth series, all series are
|
||||||
|
// treated as such by writing the "chart:interpolation" attribute
|
||||||
|
for i := 0 to AChart.Series.Count-1 do
|
||||||
|
if AChart.Series[i] is TsCustomLineSeries then
|
||||||
|
begin
|
||||||
|
interpolation := TsOpenedCustomLineSeries(AChart.Series[i]).Interpolation;
|
||||||
|
case interpolation of
|
||||||
|
ciLinear: Continue;
|
||||||
ciCubicSpline: interpolationStr := 'chart:interpolation="cubic-spline" ';
|
ciCubicSpline: interpolationStr := 'chart:interpolation="cubic-spline" ';
|
||||||
ciBSpline: interpolationStr := 'chart:interpolation="b-spline" ';
|
ciBSpline: interpolationStr := 'chart:interpolation="b-spline" ';
|
||||||
ciStepStart: interpolationStr := 'chart:interpolation="step-start" ';
|
ciStepStart: interpolationStr := 'chart:interpolation="step-start" ';
|
||||||
@ -2634,6 +2645,8 @@ begin
|
|||||||
ciStepCenterX: interpolationStr := 'chart:interpolation="step-center-x" ';
|
ciStepCenterX: interpolationStr := 'chart:interpolation="step-center-x" ';
|
||||||
ciStepCenterY: interpolationStr := 'chart:interpolation="step-center-y" ';
|
ciStepCenterY: interpolationStr := 'chart:interpolation="step-center-y" ';
|
||||||
end;
|
end;
|
||||||
|
break;
|
||||||
|
end;
|
||||||
|
|
||||||
if not (AChart.GetChartType in [ctRadar, ctFilledRadar, ctPie]) then
|
if not (AChart.GetChartType in [ctRadar, ctFilledRadar, ctPie]) then
|
||||||
rightAngledAxes := 'chart:right-angled-axes="true" ';
|
rightAngledAxes := 'chart:right-angled-axes="true" ';
|
||||||
|
|||||||
@ -114,6 +114,7 @@ type
|
|||||||
procedure WriteAreaSeries(AStream: TStream; AIndent: Integer; ASeries: TsAreaSeries; ASeriesIndex, APosInAxisGroup: Integer);
|
procedure WriteAreaSeries(AStream: TStream; AIndent: Integer; ASeries: TsAreaSeries; ASeriesIndex, APosInAxisGroup: Integer);
|
||||||
procedure WriteBarSeries(AStream: TStream; AIndent: Integer; ASeries: TsBarSeries; ASeriesIndex, APosInAxisGroup: Integer);
|
procedure WriteBarSeries(AStream: TStream; AIndent: Integer; ASeries: TsBarSeries; ASeriesIndex, APosInAxisGroup: Integer);
|
||||||
procedure WriteBubbleSeries(AStream: TStream; AIndent: Integer; ASeries: TsBubbleSeries; ASeriesIndex, APosInAxisGroup: Integer);
|
procedure WriteBubbleSeries(AStream: TStream; AIndent: Integer; ASeries: TsBubbleSeries; ASeriesIndex, APosInAxisGroup: Integer);
|
||||||
|
procedure WriteLineSeries(AStream: TStream; AIndent: Integer; ASeries: TsLineSeries; ASeriesIndex, APosInAxisGroup: Integer);
|
||||||
procedure WritePieSeries(AStream: TStream; AIndent: Integer; ASeries: TsPieSeries; ASeriesIndex: Integer);
|
procedure WritePieSeries(AStream: TStream; AIndent: Integer; ASeries: TsPieSeries; ASeriesIndex: Integer);
|
||||||
procedure WriteRadarSeries(AStream: TStream; AIndent: Integer; ASeries: TsRadarSeries; ASeriesIndex: Integer);
|
procedure WriteRadarSeries(AStream: TStream; AIndent: Integer; ASeries: TsRadarSeries; ASeriesIndex: Integer);
|
||||||
procedure WriteScatterSeries(AStream: TStream; AIndent: Integer; ASeries: TsScatterSeries; ASeriesIndex, APosInAxisGroup: Integer);
|
procedure WriteScatterSeries(AStream: TStream; AIndent: Integer; ASeries: TsScatterSeries; ASeriesIndex, APosInAxisGroup: Integer);
|
||||||
@ -1280,6 +1281,7 @@ begin
|
|||||||
while Assigned(ANode) do
|
while Assigned(ANode) do
|
||||||
begin
|
begin
|
||||||
nodeName := ANode.NodeName;
|
nodeName := ANode.NodeName;
|
||||||
|
s := GetAttrValue(ANode, 'val');
|
||||||
case nodeName of
|
case nodeName of
|
||||||
'c:ser':
|
'c:ser':
|
||||||
begin
|
begin
|
||||||
@ -1287,19 +1289,14 @@ begin
|
|||||||
ReadChartSeriesProps(ANode.FirstChild, ser);
|
ReadChartSeriesProps(ANode.FirstChild, ser);
|
||||||
end;
|
end;
|
||||||
'c:grouping':
|
'c:grouping':
|
||||||
begin
|
|
||||||
s := GetAttrValue(ANode, 'val');
|
|
||||||
case s of
|
case s of
|
||||||
'stacked': AChart.StackMode := csmStacked;
|
'stacked': AChart.StackMode := csmStacked;
|
||||||
'percentStacked': AChart.StackMode := csmStackedPercentage;
|
'percentStacked': AChart.StackMode := csmStackedPercentage;
|
||||||
end;
|
end;
|
||||||
end;
|
|
||||||
'c:varyColors':
|
'c:varyColors':
|
||||||
;
|
;
|
||||||
'c:dLbls':
|
'c:dLbls':
|
||||||
;
|
;
|
||||||
'c:gapWidth':
|
|
||||||
;
|
|
||||||
{
|
{
|
||||||
'c:axId':
|
'c:axId':
|
||||||
ReadChartSeriesAxis(ANode, ser);
|
ReadChartSeriesAxis(ANode, ser);
|
||||||
@ -1481,14 +1478,6 @@ begin
|
|||||||
1: ReadChartAxis(workNode.FirstChild, AChart, AChart.X2Axis, FX2AxisID, FX2AxisDelete);
|
1: ReadChartAxis(workNode.FirstChild, AChart, AChart.X2Axis, FX2AxisID, FX2AxisDelete);
|
||||||
end;
|
end;
|
||||||
inc(catAxCounter);
|
inc(catAxCounter);
|
||||||
{
|
|
||||||
if (AChart.X2Axis.Alignment = AChart.XAxis.Alignment) and FX2AxisDelete then
|
|
||||||
begin
|
|
||||||
// Force using only a single x axis in this case
|
|
||||||
FX2AxisID := FXAxisID;
|
|
||||||
AChart.X2Axis.Visible := false;
|
|
||||||
end;
|
|
||||||
}
|
|
||||||
end;
|
end;
|
||||||
'c:dateAx':
|
'c:dateAx':
|
||||||
begin
|
begin
|
||||||
@ -1503,14 +1492,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
inc(dateAxCounter);
|
inc(dateAxCounter);
|
||||||
{
|
|
||||||
if (dateAxCounter > 1) and (AChart.X2Axis.Alignment = AChart.XAxis.Alignment) and FX2AxisDelete then
|
|
||||||
begin
|
|
||||||
// Force using only a single x axis in this case.
|
|
||||||
FX2AxisID := FXAxisID;
|
|
||||||
AChart.X2Axis.Visible := false;
|
|
||||||
end;
|
|
||||||
}
|
|
||||||
end;
|
end;
|
||||||
'c:valAx':
|
'c:valAx':
|
||||||
begin
|
begin
|
||||||
@ -1527,14 +1508,6 @@ begin
|
|||||||
2: ReadChartAxis(workNode.FirstChild, AChart, AChart.Y2Axis, FY2AxisID, FY2AxisDelete);
|
2: ReadChartAxis(workNode.FirstChild, AChart, AChart.Y2Axis, FY2AxisID, FY2AxisDelete);
|
||||||
3: ReadChartAxis(workNode.FirstChild, AChart, AChart.X2Axis, FX2AxisID, FX2AxisDelete);
|
3: ReadChartAxis(workNode.FirstChild, AChart, AChart.X2Axis, FX2AxisID, FX2AxisDelete);
|
||||||
end;
|
end;
|
||||||
{
|
|
||||||
if (AChart.X2Axis.Alignment = AChart.XAxis.Alignment) and FX2AxisDelete then
|
|
||||||
begin
|
|
||||||
// Force using only a single x axis in this case.
|
|
||||||
FX2AxisID := FXAxisID;
|
|
||||||
AChart.X2Axis.Visible := false;
|
|
||||||
end;
|
|
||||||
}
|
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
case valAxCounter of
|
case valAxCounter of
|
||||||
@ -1665,6 +1638,7 @@ var
|
|||||||
nodeName: String;
|
nodeName: String;
|
||||||
s: String;
|
s: String;
|
||||||
ser: TsScatterSeries;
|
ser: TsScatterSeries;
|
||||||
|
smooth: Boolean = false;
|
||||||
begin
|
begin
|
||||||
if ANode = nil then
|
if ANode = nil then
|
||||||
exit;
|
exit;
|
||||||
@ -1681,9 +1655,10 @@ begin
|
|||||||
begin
|
begin
|
||||||
s := GetAttrValue(ANode, 'val');
|
s := GetAttrValue(ANode, 'val');
|
||||||
if (s = 'smoothMarker') then
|
if (s = 'smoothMarker') then
|
||||||
AChart.Interpolation := ciCubicSpline;
|
smooth := true;
|
||||||
end;
|
end;
|
||||||
'c:varyColors': ;
|
'c:varyColors':
|
||||||
|
;
|
||||||
'c:dLbls':
|
'c:dLbls':
|
||||||
;
|
;
|
||||||
'c:axId':
|
'c:axId':
|
||||||
@ -1691,6 +1666,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
ANode := ANode.NextSibling;
|
ANode := ANode.NextSibling;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
ser.Smooth := smooth;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{@@ ----------------------------------------------------------------------------
|
{@@ ----------------------------------------------------------------------------
|
||||||
@ -1971,6 +1948,7 @@ var
|
|||||||
nodeName, s: String;
|
nodeName, s: String;
|
||||||
n: Integer;
|
n: Integer;
|
||||||
idx: Integer;
|
idx: Integer;
|
||||||
|
smooth: Boolean = false;
|
||||||
begin
|
begin
|
||||||
if ANode = nil then
|
if ANode = nil then
|
||||||
exit;
|
exit;
|
||||||
@ -2011,6 +1989,8 @@ begin
|
|||||||
ReadChartSeriesTrendLine(ANode.FirstChild, ASeries);
|
ReadChartSeriesTrendLine(ANode.FirstChild, ASeries);
|
||||||
'c:errBars':
|
'c:errBars':
|
||||||
ReadChartSeriesErrorBars(ANode.FirstChild, ASeries);
|
ReadChartSeriesErrorBars(ANode.FirstChild, ASeries);
|
||||||
|
'c:smooth':
|
||||||
|
smooth := (s <> '0');
|
||||||
'c:invertIfNegative':
|
'c:invertIfNegative':
|
||||||
;
|
;
|
||||||
'c:extLst':
|
'c:extLst':
|
||||||
@ -2018,6 +1998,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
ANode := ANode.NextSibling;
|
ANode := ANode.NextSibling;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
if ASeries is TsCustomLineSeries then
|
||||||
|
TsOpenedCustomLineSeries(ASeries).Smooth := smooth;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{@@ ----------------------------------------------------------------------------
|
{@@ ----------------------------------------------------------------------------
|
||||||
@ -4028,7 +4011,12 @@ begin
|
|||||||
chart := ASeries.Chart;
|
chart := ASeries.Chart;
|
||||||
ser := TsOpenedCustomLineSeries(ASeries);
|
ser := TsOpenedCustomLineSeries(ASeries);
|
||||||
|
|
||||||
if ser.ShowSymbols then
|
if not ser.ShowSymbols then
|
||||||
|
begin
|
||||||
|
Result := indent + '<c:symbol val="none"/>';
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
case ser.Symbol of
|
case ser.Symbol of
|
||||||
cssRect: markerStr := 'square';
|
cssRect: markerStr := 'square';
|
||||||
cssDiamond: markerStr := 'diamond';
|
cssDiamond: markerStr := 'diamond';
|
||||||
@ -4044,9 +4032,7 @@ begin
|
|||||||
cssDash: markerStr := 'dash';
|
cssDash: markerStr := 'dash';
|
||||||
cssDot: markerStr := 'dot';
|
cssDot: markerStr := 'dot';
|
||||||
else markerStr := 'star'; // !!!
|
else markerStr := 'star'; // !!!
|
||||||
end // The symbols marked by !!! are not available in Excel
|
end; // The symbols marked by !!! are not available in Excel
|
||||||
else
|
|
||||||
markerStr := 'none';
|
|
||||||
|
|
||||||
symbolSizePts := round(mmToPts((ser.SymbolWidth + ser.SymbolHeight)/2));
|
symbolSizePts := round(mmToPts((ser.SymbolWidth + ser.SymbolHeight)/2));
|
||||||
if symbolSizePts > 72 then symbolSizePts := 72;
|
if symbolSizePts > 72 then symbolSizePts := 72;
|
||||||
@ -4190,6 +4176,8 @@ begin
|
|||||||
WriteBubbleSeries(AStream, AIndent + 2, TsBubbleSeries(ser), j, posInGroup);
|
WriteBubbleSeries(AStream, AIndent + 2, TsBubbleSeries(ser), j, posInGroup);
|
||||||
xAxKind := 'c:valAx';
|
xAxKind := 'c:valAx';
|
||||||
end;
|
end;
|
||||||
|
ctLine:
|
||||||
|
WriteLineSeries(AStream, AIndent + 2, TsLineSeries(ser), j, posInGroup);
|
||||||
ctPie, ctRing:
|
ctPie, ctRing:
|
||||||
WritePieSeries(AStream, AIndent + 2, TsPieSeries(ser), j);
|
WritePieSeries(AStream, AIndent + 2, TsPieSeries(ser), j);
|
||||||
ctRadar, ctFilledRadar:
|
ctRadar, ctFilledRadar:
|
||||||
@ -4573,7 +4561,6 @@ begin
|
|||||||
indent + ' </c:spPr>' + LE
|
indent + ' </c:spPr>' + LE
|
||||||
);
|
);
|
||||||
end;
|
end;
|
||||||
if TsOpenedCustomLineSeries(ASeries).ShowSymbols then
|
|
||||||
AppendToStream(AStream,
|
AppendToStream(AStream,
|
||||||
indent + ' <c:marker>' + LE +
|
indent + ' <c:marker>' + LE +
|
||||||
GetChartSeriesMarkerXML(AIndent + 4, TsOpenedCustomLineSeries(ASeries)) + LE +
|
GetChartSeriesMarkerXML(AIndent + 4, TsOpenedCustomLineSeries(ASeries)) + LE +
|
||||||
@ -4629,9 +4616,9 @@ begin
|
|||||||
[ yValName ]
|
[ yValName ]
|
||||||
));
|
));
|
||||||
|
|
||||||
|
// Bubble series: Bubble size range
|
||||||
if (ASeries is TsBubbleSeries) then
|
if (ASeries is TsBubbleSeries) then
|
||||||
begin
|
begin
|
||||||
// Bubble size range
|
|
||||||
AppendToStream(AStream,
|
AppendToStream(AStream,
|
||||||
indent + '<c:bubbleSize>' + LE +
|
indent + '<c:bubbleSize>' + LE +
|
||||||
indent + GetChartRangeXML(AIndent + 4, TsBubbleSeries(ASeries).BubbleRange, 'c:numRef') + LE +
|
indent + GetChartRangeXML(AIndent + 4, TsBubbleSeries(ASeries).BubbleRange, 'c:numRef') + LE +
|
||||||
@ -4639,6 +4626,13 @@ begin
|
|||||||
);
|
);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// Line series: Interpolation
|
||||||
|
if ASeries is TsLineSeries then
|
||||||
|
if TsLineSeries(ASeries).Interpolation in [ciLinear, ciStepStart, ciStepEnd, ciStepCenterX, ciStepCenterY] then
|
||||||
|
AppendToStream(AStream,
|
||||||
|
indent + ' <c:smooth val="0"/>' + LE
|
||||||
|
);
|
||||||
|
|
||||||
AppendToStream(AStream,
|
AppendToStream(AStream,
|
||||||
indent + '</c:ser>' + LE
|
indent + '</c:ser>' + LE
|
||||||
);
|
);
|
||||||
@ -4734,6 +4728,67 @@ begin
|
|||||||
);
|
);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{@@ ----------------------------------------------------------------------------
|
||||||
|
Writes the properties of the given line series to the <c:plotArea> node of
|
||||||
|
file chartN.xml
|
||||||
|
-------------------------------------------------------------------------------}
|
||||||
|
procedure TsSpreadOOXMLChartWriter.WriteLineSeries(AStream: TStream;
|
||||||
|
AIndent: Integer; ASeries: TsLineSeries; ASeriesIndex, APosInAxisGroup: Integer);
|
||||||
|
const
|
||||||
|
GROUPING: Array[TsChartStackMode] of string = ('standard', 'stacked', 'percentStacked');
|
||||||
|
var
|
||||||
|
indent: String;
|
||||||
|
chart: TsChart;
|
||||||
|
xAxis: TsChartAxis;
|
||||||
|
isFirstOfGroup: Boolean;
|
||||||
|
isLastOfGroup: Boolean;
|
||||||
|
prevSeriesGroupIndex: Integer = -1;
|
||||||
|
nextSeriesGroupIndex: Integer = -1;
|
||||||
|
begin
|
||||||
|
indent := DupeString(' ', AIndent);
|
||||||
|
chart := ASeries.Chart;
|
||||||
|
|
||||||
|
if (ASeriesIndex > 0) and (chart.Series[ASeriesIndex-1].YAxis = ASeries.YAxis) then
|
||||||
|
prevSeriesGroupIndex := chart.Series[ASeriesIndex-1].GroupIndex;
|
||||||
|
if (ASeriesIndex < chart.Series.Count-1) and (chart.Series[ASeriesIndex+1].YAxis = ASeries.YAxis) then
|
||||||
|
nextSeriesGroupIndex := chart.Series[ASeriesIndex+1].GroupIndex;
|
||||||
|
|
||||||
|
isFirstOfGroup := APosInAxisGroup and 1 = 1;
|
||||||
|
isLastOfGroup := APosInAxisgroup and 2 = 2;
|
||||||
|
|
||||||
|
if ((ASeries.GroupIndex > -1) and (prevSeriesGroupIndex = ASeries.GroupIndex)) then
|
||||||
|
isFirstOfGroup := false;
|
||||||
|
if ((ASeries.GroupIndex > -1) and (nextSeriesGroupIndex = ASeries.GroupIndex)) then
|
||||||
|
isLastOfGroup := false;
|
||||||
|
|
||||||
|
if isFirstOfGroup then
|
||||||
|
AppendToStream(AStream, Format(
|
||||||
|
indent + '<c:lineChart>' + LE +
|
||||||
|
indent + ' <c:grouping val="%s"/>' + LE,
|
||||||
|
[ GROUPING[chart.StackMode] ]
|
||||||
|
));
|
||||||
|
|
||||||
|
WriteChartSeriesNode(AStream, AIndent + 2, ASeries, ASeriesIndex);
|
||||||
|
|
||||||
|
if isLastOfGroup then
|
||||||
|
begin
|
||||||
|
if ASeries.YAxis = calPrimary then
|
||||||
|
xAxis := chart.XAxis
|
||||||
|
else
|
||||||
|
xAxis := chart.X2Axis;
|
||||||
|
|
||||||
|
AppendToStream(AStream, Format(
|
||||||
|
indent + ' <c:axId val="%d"/>' + LE +
|
||||||
|
indent + ' <c:axId val="%d"/>' + LE +
|
||||||
|
indent + '</c:lineChart>' + LE,
|
||||||
|
[
|
||||||
|
FAxisID[xAxis.Alignment], // <c:axId>
|
||||||
|
FAxisID[ASeries.GetYAxis.Alignment] // <c:axId>
|
||||||
|
]
|
||||||
|
));
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|||||||
@ -19,7 +19,7 @@ interface
|
|||||||
|
|
||||||
{$ifdef FPS_CHARTS}
|
{$ifdef FPS_CHARTS}
|
||||||
|
|
||||||
uses
|
uses lazloggerbase,
|
||||||
// RTL/FCL
|
// RTL/FCL
|
||||||
Classes, Contnrs, SysUtils, Types, FPCanvas,
|
Classes, Contnrs, SysUtils, Types, FPCanvas,
|
||||||
// LCL
|
// LCL
|
||||||
@ -1079,7 +1079,6 @@ procedure TsWorkbookChartSource.UseDataPointColors(ASeries: TsChartSeries);
|
|||||||
|
|
||||||
var
|
var
|
||||||
datapointStyle: TsChartDataPointStyle;
|
datapointStyle: TsChartDataPointStyle;
|
||||||
style: TChartStyle;
|
|
||||||
i, j: Integer;
|
i, j: Integer;
|
||||||
c: TsColor;
|
c: TsColor;
|
||||||
g: TsChartGradient;
|
g: TsChartGradient;
|
||||||
@ -1187,6 +1186,7 @@ var
|
|||||||
firstSeries: TChartSeries;
|
firstSeries: TChartSeries;
|
||||||
ch: TsChart;
|
ch: TsChart;
|
||||||
src: TsWorkbookChartSource;
|
src: TsWorkbookChartSource;
|
||||||
|
interpolation: TsChartInterpolation = ciLinear;
|
||||||
calcSrc: TCalculatedChartSource;
|
calcSrc: TCalculatedChartSource;
|
||||||
style: TChartStyle;
|
style: TChartStyle;
|
||||||
axAlign: TChartAxisAlignment;
|
axAlign: TChartAxisAlignment;
|
||||||
@ -1246,6 +1246,14 @@ begin
|
|||||||
src := TsWorkbookChartSource.Create(self);
|
src := TsWorkbookChartSource.Create(self);
|
||||||
src.WorkbookSource := FWorkbookSource;
|
src.WorkbookSource := FWorkbookSource;
|
||||||
|
|
||||||
|
if (ASeries is TsCustomLineSeries) then
|
||||||
|
begin
|
||||||
|
interpolation := TsOpenedCustomLineSeries(ASeries).Interpolation;
|
||||||
|
// TAChart cannot stack spline series.
|
||||||
|
if (interpolation in [ciBSpline, ciCubicSpline]) and (ch.StackMode <> csmDefault) then
|
||||||
|
interpolation := ciLinear;
|
||||||
|
end;
|
||||||
|
|
||||||
case ASeries.ChartType of
|
case ASeries.ChartType of
|
||||||
ctBar:
|
ctBar:
|
||||||
begin
|
begin
|
||||||
@ -1253,11 +1261,11 @@ begin
|
|||||||
src.IntegerX := true;
|
src.IntegerX := true;
|
||||||
end;
|
end;
|
||||||
ctLine, ctScatter:
|
ctLine, ctScatter:
|
||||||
case ch.Interpolation of
|
case interpolation of
|
||||||
ciLinear, ciStepStart, ciStepEnd, ciStepCenterX, ciStepCenterY:
|
ciLinear, ciStepStart, ciStepEnd, ciStepCenterX, ciStepCenterY:
|
||||||
begin
|
begin
|
||||||
Result := TLineSeries.Create(FChart);
|
Result := TLineSeries.Create(FChart);
|
||||||
case ch.Interpolation of
|
case interpolation of
|
||||||
ciLinear: TLineSeries(Result).LineType := ltFromPrevious;
|
ciLinear: TLineSeries(Result).LineType := ltFromPrevious;
|
||||||
ciStepStart: TLineSeries(Result).LineType := ltStepXY;
|
ciStepStart: TLineSeries(Result).LineType := ltStepXY;
|
||||||
ciStepEnd: TLineSeries(Result).LineType := ltStepYX;
|
ciStepEnd: TLineSeries(Result).LineType := ltStepYX;
|
||||||
@ -1890,27 +1898,34 @@ end;
|
|||||||
function TsWorkbookChartLink.IsStackable(ASeries: TsChartSeries): Boolean;
|
function TsWorkbookChartLink.IsStackable(ASeries: TsChartSeries): Boolean;
|
||||||
var
|
var
|
||||||
ch: TsChart;
|
ch: TsChart;
|
||||||
|
ser: TsChartSeries;
|
||||||
i, numSeries: Integer;
|
i, numSeries: Integer;
|
||||||
begin
|
begin
|
||||||
Result := (ASeries.ChartType in [ctBar, ctLine, ctArea]);
|
Result := (ASeries.ChartType in [ctBar, ctLine, ctArea]) and (ASeries.GroupIndex > -1);
|
||||||
if Result then
|
if Result then
|
||||||
begin
|
begin
|
||||||
ch := ASeries.Chart;
|
ch := ASeries.Chart;
|
||||||
numSeries := ch.Series.Count;
|
numSeries := ch.Series.Count;
|
||||||
if numSeries = 1 then
|
if numSeries = 1 then
|
||||||
|
begin
|
||||||
|
Result := false;
|
||||||
exit;
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
// Check whether all series are the same type and same y axis as ASeries.
|
// Check whether all series are the same type and same y axis as ASeries.
|
||||||
// NOTE: Not perfect yet since there might abe two stackable groups,
|
// NOTE: Not perfect yet since there might abe two stackable groups,
|
||||||
// one for the left and one for the right axis...
|
// one for the left and one for the right axis...
|
||||||
for i := 0 to numSeries - 1 do
|
for i := 0 to numSeries - 1 do
|
||||||
if (ch.Series[i].ChartType <> ASeries.ChartType) or
|
begin
|
||||||
(ch.Series[i].YAxis <> ASeries.YAxis) then
|
ser := ch.Series[i];
|
||||||
|
if (ser.ChartType <> ASeries.ChartType) or (ser.GroupIndex <> ASeries.GroupIndex) or
|
||||||
|
(ser.YAxis <> ASeries.YAxis) then
|
||||||
begin
|
begin
|
||||||
Result := false;
|
Result := false;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TsWorkbookChartLink.ListenerNotification(AChangedItems: TsNotificationItems;
|
procedure TsWorkbookChartLink.ListenerNotification(AChangedItems: TsNotificationItems;
|
||||||
@ -2661,10 +2676,15 @@ procedure TsWorkbookChartLink.UpdateChartStyle(AWorkbookSeries: TsChartSeries;
|
|||||||
AStyleIndex: Integer);
|
AStyleIndex: Integer);
|
||||||
var
|
var
|
||||||
style: TChartStyle;
|
style: TChartStyle;
|
||||||
|
ch: TsChart;
|
||||||
begin
|
begin
|
||||||
|
ch := AWorkbookSeries.Chart;
|
||||||
style := TChartStyle(FChartStyles.Styles[AStyleIndex]);
|
style := TChartStyle(FChartStyles.Styles[AStyleIndex]);
|
||||||
UpdateChartPen(AWorkbookSeries.Chart, AWorkbookSeries.Line, style.Pen);
|
UpdateChartPen(ch, AWorkbookSeries.Line, style.Pen);
|
||||||
UpdateChartBrush(AWorkbookSeries.Chart, AWorkbookSeries.Fill, style.Brush);
|
if (AWorkbookSeries is TsCustomLineSeries) then
|
||||||
|
UpdateChartBrush(ch, TsOpenedCustomLineSeries(AWorkbookSeries).SymbolFill, style.Brush)
|
||||||
|
else
|
||||||
|
UpdateChartBrush(ch, AWorkbookSeries.Fill, style.Brush);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{@@ Updates title and footer of the linked TAChart.
|
{@@ Updates title and footer of the linked TAChart.
|
||||||
@ -2731,6 +2751,9 @@ begin
|
|||||||
seriesPointer.HorizSize := mmToPx(openedWorkbookSeries.SymbolWidth / 2, ppi);
|
seriesPointer.HorizSize := mmToPx(openedWorkbookSeries.SymbolWidth / 2, ppi);
|
||||||
seriesPointer.VertSize := mmToPx(openedWorkbookSeries.SymbolHeight / 2, ppi);
|
seriesPointer.VertSize := mmToPx(openedWorkbookSeries.SymbolHeight / 2, ppi);
|
||||||
|
|
||||||
|
if lineseries <> nil then
|
||||||
|
DebugLn([BoolToStr(lineseries.ShowPoints, true), ' ', intTostr(ord(lineseries.pointer.Style)), ' ', inttostr(ord(lineseries.pointer.brush.style))]);
|
||||||
|
|
||||||
// Error bars
|
// Error bars
|
||||||
UpdateChartErrorBars(AWorkbookSeries, AChartSeries);
|
UpdateChartErrorBars(AWorkbookSeries, AChartSeries);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user