You've already forked lazarus-ccr
fpspreadsheet: Support radar charts.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9002 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -8,8 +8,9 @@ const
|
|||||||
// SERIES_CLASS: TsChartSeriesClass = TsAreaSeries;
|
// SERIES_CLASS: TsChartSeriesClass = TsAreaSeries;
|
||||||
// SERIES_CLASS: TsChartSeriesClass = TsBarSeries;
|
// SERIES_CLASS: TsChartSeriesClass = TsBarSeries;
|
||||||
// SERIES_CLASS: TsChartSeriesClass = TsBubbleSeries;
|
// SERIES_CLASS: TsChartSeriesClass = TsBubbleSeries;
|
||||||
SERIES_CLASS: TsChartSeriesClass = TsLineSeries;
|
// SERIES_CLASS: TsChartSeriesClass = TsLineSeries;
|
||||||
// SERIES_CLASS: TsChartSeriesClass = TsScatterSeries;
|
// SERIES_CLASS: TsChartSeriesClass = TsScatterSeries;
|
||||||
|
SERIES_CLASS: TsChartSeriesClass = TsRadarSeries;
|
||||||
r1 = 1;
|
r1 = 1;
|
||||||
r2 = 8;
|
r2 = 8;
|
||||||
FILL_COLORS: array[0..r2-r1] of TsColor = (scRed, scGreen, scBlue, scYellow, scMagenta, scSilver, scBlack, scOlive);
|
FILL_COLORS: array[0..r2-r1] of TsColor = (scRed, scGreen, scBlue, scYellow, scMagenta, scSilver, scBlack, scOlive);
|
||||||
|
@ -113,7 +113,7 @@ type
|
|||||||
TsChartAxisPosition = (capStart, capEnd, capValue);
|
TsChartAxisPosition = (capStart, capEnd, capValue);
|
||||||
TsChartAxisTick = (catInside, catOutside);
|
TsChartAxisTick = (catInside, catOutside);
|
||||||
TsChartAxisTicks = set of TsChartAxisTick;
|
TsChartAxisTicks = set of TsChartAxisTick;
|
||||||
TsChartType = (ctEmpty, ctBar, ctLine, ctArea, ctBarLine, ctScatter, ctBubble);
|
TsChartType = (ctEmpty, ctBar, ctLine, ctArea, ctBarLine, ctScatter, ctBubble, ctRadar);
|
||||||
|
|
||||||
TsChartAxis = class(TsChartFillElement)
|
TsChartAxis = class(TsChartFillElement)
|
||||||
private
|
private
|
||||||
@ -287,6 +287,11 @@ type
|
|||||||
property ShowSymbols: Boolean read FShowSymbols write FShowSymbols;
|
property ShowSymbols: Boolean read FShowSymbols write FShowSymbols;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
TsRadarSeries = class(TsLineSeries)
|
||||||
|
public
|
||||||
|
constructor Create(AChart: TsChart); override;
|
||||||
|
end;
|
||||||
|
|
||||||
TsScatterSeries = class(TsLineSeries)
|
TsScatterSeries = class(TsLineSeries)
|
||||||
public
|
public
|
||||||
constructor Create(AChart: TsChart); override;
|
constructor Create(AChart: TsChart); override;
|
||||||
@ -799,6 +804,14 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{ TsRadarSeries }
|
||||||
|
constructor TsRadarSeries.Create(AChart: TsChart);
|
||||||
|
begin
|
||||||
|
inherited Create(AChart);
|
||||||
|
FChartType := ctRadar;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ TsScatterSeries }
|
{ TsScatterSeries }
|
||||||
|
|
||||||
constructor TsScatterSeries.Create(AChart: TsChart);
|
constructor TsScatterSeries.Create(AChart: TsChart);
|
||||||
|
@ -73,7 +73,7 @@ const
|
|||||||
OPENDOC_PATH_CHART_STYLES = 'Object %d/styles.xml';
|
OPENDOC_PATH_CHART_STYLES = 'Object %d/styles.xml';
|
||||||
|
|
||||||
CHART_TYPE_NAMES: array[TsChartType] of string = (
|
CHART_TYPE_NAMES: array[TsChartType] of string = (
|
||||||
'', 'bar', 'line', 'area', 'barLine', 'scatter', 'bubble'
|
'', 'bar', 'line', 'area', 'barLine', 'scatter', 'bubble', 'radar'
|
||||||
);
|
);
|
||||||
|
|
||||||
CHART_SYMBOL_NAMES: array[TsChartSeriesSymbol] of String = (
|
CHART_SYMBOL_NAMES: array[TsChartSeriesSymbol] of String = (
|
||||||
@ -446,6 +446,7 @@ var
|
|||||||
interpolationStr: String = '';
|
interpolationStr: String = '';
|
||||||
verticalStr: String = '';
|
verticalStr: String = '';
|
||||||
stackModeStr: String = '';
|
stackModeStr: String = '';
|
||||||
|
rightAngledAxes: String = '';
|
||||||
begin
|
begin
|
||||||
indent := DupeString(' ', AIndent);
|
indent := DupeString(' ', AIndent);
|
||||||
|
|
||||||
@ -468,6 +469,9 @@ begin
|
|||||||
ciStepCenterY: interpolationStr := 'chart:interpolation="step-center-y" ';
|
ciStepCenterY: interpolationStr := 'chart:interpolation="step-center-y" ';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
if AChart.GetChartType <> ctRadar then
|
||||||
|
rightAngledAxes := 'chart:right-angled-axes="true" ';
|
||||||
|
|
||||||
Result := Format(
|
Result := Format(
|
||||||
indent + ' <style:style style:name="ch%d" style:family="chart">', [ AStyleID ]) + LE +
|
indent + ' <style:style style:name="ch%d" style:family="chart">', [ AStyleID ]) + LE +
|
||||||
indent + ' <style:chart-properties ' +
|
indent + ' <style:chart-properties ' +
|
||||||
@ -479,7 +483,8 @@ begin
|
|||||||
'chart:auto-position="true" ' +
|
'chart:auto-position="true" ' +
|
||||||
'chart:auto-size="true" ' +
|
'chart:auto-size="true" ' +
|
||||||
'chart:treat-empty-cells="leave-gap" ' +
|
'chart:treat-empty-cells="leave-gap" ' +
|
||||||
'chart:right-angled-axes="true"/>' + LE +
|
rightAngledAxes +
|
||||||
|
'/>' + LE +
|
||||||
indent + ' </style:style>' + LE;
|
indent + ' </style:style>' + LE;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -526,7 +531,11 @@ begin
|
|||||||
FPointSeparatorSettings
|
FPointSeparatorSettings
|
||||||
);
|
);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
chartProps := chartProps + 'chart:link-data-style-to-source="true" ';
|
chartProps := chartProps + 'chart:link-data-style-to-source="true" ';
|
||||||
|
// to do: link-data-style-to-source must go to "false" in case of a specific
|
||||||
|
// numeric label format. But that requires a number-style in the Object/style.xml
|
||||||
|
|
||||||
if ([cdlValue, cdlPercentage] * series.DataLabels = [cdlValue]) then
|
if ([cdlValue, cdlPercentage] * series.DataLabels = [cdlValue]) then
|
||||||
chartProps := chartProps + 'chart:data-label-number="value" '
|
chartProps := chartProps + 'chart:data-label-number="value" '
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user