fpspreadsheet: Fix border when drawing data point marks.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9060 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
5388647a4a
commit
940295ae28
@ -24,6 +24,7 @@ object Form1: TForm1
|
|||||||
AutoAdvance = aaDown
|
AutoAdvance = aaDown
|
||||||
DefaultColWidth = 64
|
DefaultColWidth = 64
|
||||||
DefaultRowHeight = 22
|
DefaultRowHeight = 22
|
||||||
|
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing, goSmoothScroll]
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
object Splitter1: TSplitter
|
object Splitter1: TSplitter
|
||||||
|
@ -28,6 +28,7 @@ type
|
|||||||
function FindStyleNode(AStyleNodes: TDOMNode; AStyleName: String): TDOMNode;
|
function FindStyleNode(AStyleNodes: TDOMNode; AStyleName: String): TDOMNode;
|
||||||
procedure GetChartFillProps(ANode: TDOMNode; AChart: TsChart; AFill: TsChartFill);
|
procedure GetChartFillProps(ANode: TDOMNode; AChart: TsChart; AFill: TsChartFill);
|
||||||
procedure GetChartLineProps(ANode: TDOMNode; AChart: TsChart; ALine: TsChartLine);
|
procedure GetChartLineProps(ANode: TDOMNode; AChart: TsChart; ALine: TsChartLine);
|
||||||
|
procedure GetChartTextProps(ANode: TDOMNode; AFont: TsFont);
|
||||||
|
|
||||||
procedure ReadChartAxisGrid(ANode, AStyleNode: TDOMNode; AChart: TsChart; Axis: TsChartAxis);
|
procedure ReadChartAxisGrid(ANode, AStyleNode: TDOMNode; AChart: TsChart; Axis: TsChartAxis);
|
||||||
procedure ReadChartAxisProps(ANode, AStyleNode: TDOMNode; AChart: TsChart);
|
procedure ReadChartAxisProps(ANode, AStyleNode: TDOMNode; AChart: TsChart);
|
||||||
@ -146,6 +147,8 @@ const
|
|||||||
OPENDOC_PATH_CHART_CONTENT = 'Object %d/content.xml';
|
OPENDOC_PATH_CHART_CONTENT = 'Object %d/content.xml';
|
||||||
OPENDOC_PATH_CHART_STYLES = 'Object %d/styles.xml';
|
OPENDOC_PATH_CHART_STYLES = 'Object %d/styles.xml';
|
||||||
|
|
||||||
|
DEFAULT_FONT_NAME = 'Liberation Sans';
|
||||||
|
|
||||||
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', 'filled-radar', 'circle', 'ring'
|
'radar', 'filled-radar', 'circle', 'ring'
|
||||||
@ -519,25 +522,13 @@ begin
|
|||||||
ALine.Transparency := 1.0 - value*0.01;
|
ALine.Transparency := 1.0 - value*0.01;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
(*
|
procedure TsSpreadOpenDocChartReader.GetChartTextProps(ANode: TDOMNode;
|
||||||
function TsSpreadOpenDocChartWriter.GetChartBackgroundStyleAsXML(
|
AFont: TsFont);
|
||||||
AChart: TsChart; AFill: TsChartFill; ABorder: TsChartLine;
|
|
||||||
AIndent, AStyleID: Integer): String;
|
|
||||||
var
|
|
||||||
indent: String;
|
|
||||||
fillStr: String = '';
|
|
||||||
borderStr: String = '';
|
|
||||||
begin
|
begin
|
||||||
fillStr := GetChartFillStyleGraphicPropsAsXML(AChart, AFill);
|
TsSpreadOpenDocReader(Reader).ReadFont(ANode, AFont);
|
||||||
borderStr := GetChartLineStyleGraphicPropsAsXML(AChart, ABorder);
|
if AFont.FontName = '' then
|
||||||
indent := DupeString(' ', AIndent);
|
AFont.FontName := DEFAULT_FONT_NAME;
|
||||||
Result := Format(
|
end;
|
||||||
indent + '<style:style style:name="ch%d" style:family="chart">' + LE +
|
|
||||||
indent + ' <style:graphic-properties %s%s />' + LE +
|
|
||||||
indent + '</style:style>' + LE,
|
|
||||||
[ AStyleID, fillStr, borderStr ]
|
|
||||||
);
|
|
||||||
end; *)
|
|
||||||
|
|
||||||
procedure TsSpreadOpenDocChartReader.ReadChart(AChartNode, AStyleNode: TDOMNode;
|
procedure TsSpreadOpenDocChartReader.ReadChart(AChartNode, AStyleNode: TDOMNode;
|
||||||
AChart: TsChart);
|
AChart: TsChart);
|
||||||
@ -692,7 +683,7 @@ begin
|
|||||||
nodeName := AStyleNode.NodeName;
|
nodeName := AStyleNode.NodeName;
|
||||||
case nodeName of
|
case nodeName of
|
||||||
'style:text-properties':
|
'style:text-properties':
|
||||||
TsSpreadOpenDocReader(Reader).ReadFont(AStyleNode, Axis.LabelFont);
|
GetChartTextProps(AStyleNode, Axis.LabelFont);
|
||||||
'style:graphic-properties':
|
'style:graphic-properties':
|
||||||
GetChartLineProps(AStyleNode, AChart, Axis.AxisLine);
|
GetChartLineProps(AStyleNode, AChart, Axis.AxisLine);
|
||||||
'style:chart-properties':
|
'style:chart-properties':
|
||||||
@ -1051,7 +1042,7 @@ begin
|
|||||||
GetChartFillProps(AStyleNode, AChart, AChart.Legend.Background);
|
GetChartFillProps(AStyleNode, AChart, AChart.Legend.Background);
|
||||||
end;
|
end;
|
||||||
'style:text-properties':
|
'style:text-properties':
|
||||||
TsSpreadOpenDocReader(Reader).ReadFont(AStyleNode, AChart.Legend.Font);
|
GetChartTextProps(AStyleNode, AChart.Legend.Font);
|
||||||
end;
|
end;
|
||||||
AStyleNode := AStyleNode.NextSibling;
|
AStyleNode := AStyleNode.NextSibling;
|
||||||
end;
|
end;
|
||||||
@ -1087,7 +1078,7 @@ begin
|
|||||||
GetChartFillProps(AStyleNode, AChart, series.Regression.Equation.Fill);
|
GetChartFillProps(AStyleNode, AChart, series.Regression.Equation.Fill);
|
||||||
end;
|
end;
|
||||||
'style:text-properties':
|
'style:text-properties':
|
||||||
odsReader.ReadFont(AStyleNode, series.Regression.Equation.Font);
|
GetChartTextProps(AStyleNode, series.Regression.Equation.Font);
|
||||||
'style:chart-properties':
|
'style:chart-properties':
|
||||||
begin
|
begin
|
||||||
s := GetAttrValue(AStyleNode, 'loext:regression-x-name');
|
s := GetAttrValue(AStyleNode, 'loext:regression-x-name');
|
||||||
@ -1286,6 +1277,10 @@ var
|
|||||||
dataLabels: TsChartDataLabels = [];
|
dataLabels: TsChartDataLabels = [];
|
||||||
childNode1, childNode2, childNode3: TDOMNode;
|
childNode1, childNode2, childNode3: TDOMNode;
|
||||||
begin
|
begin
|
||||||
|
// Defaults
|
||||||
|
ASeries.LabelBorder.Style := clsNoLine;
|
||||||
|
ASeries.LabelBackground.Style := cfsNoFill;
|
||||||
|
|
||||||
nodeName := AStyleNode.NodeName;
|
nodeName := AStyleNode.NodeName;
|
||||||
s := GetAttrValue(AStyleNode, 'style:data-style-name');
|
s := GetAttrValue(AStyleNode, 'style:data-style-name');
|
||||||
if s <> '' then
|
if s <> '' then
|
||||||
@ -1304,7 +1299,7 @@ begin
|
|||||||
GetChartFillProps(AStyleNode, AChart, ASeries.Fill);
|
GetChartFillProps(AStyleNode, AChart, ASeries.Fill);
|
||||||
end;
|
end;
|
||||||
'style:text-properties':
|
'style:text-properties':
|
||||||
TsSpreadOpenDocReader(Reader).ReadFont(AStyleNode, ASeries.LabelFont);
|
GetChartTextProps(AStyleNode, ASeries.LabelFont);
|
||||||
'style:chart-properties':
|
'style:chart-properties':
|
||||||
begin
|
begin
|
||||||
s := GetAttrValue(AStyleNode, 'chart:label-position');
|
s := GetAttrValue(AStyleNode, 'chart:label-position');
|
||||||
@ -1318,10 +1313,11 @@ begin
|
|||||||
if s <> '' then
|
if s <> '' then
|
||||||
ASeries.LabelBorder.Color := HTMLColorStrToColor(s);
|
ASeries.LabelBorder.Color := HTMLColorStrToColor(s);
|
||||||
s := GetAttrValue(AStyleNode, 'loext:label-stroke');
|
s := GetAttrValue(AStyleNode, 'loext:label-stroke');
|
||||||
case s of
|
if s <> '' then
|
||||||
'none': ASeries.LabelBorder.Style := clsNoLine;
|
case s of
|
||||||
else ASeries.LabelBorder.Style := clsSolid;
|
'none': ASeries.LabelBorder.Style := clsNoLine;
|
||||||
end;
|
else ASeries.LabelBorder.Style := clsSolid;
|
||||||
|
end;
|
||||||
|
|
||||||
s := GetAttrValue(AStyleNode, 'chart:data-label-number');
|
s := GetAttrValue(AStyleNode, 'chart:data-label-number');
|
||||||
if s <> '' then
|
if s <> '' then
|
||||||
@ -1480,7 +1476,7 @@ begin
|
|||||||
GetChartFillProps(AStyleNode, AChart, ATitle.Background);
|
GetChartFillProps(AStyleNode, AChart, ATitle.Background);
|
||||||
end;
|
end;
|
||||||
'style:text-properties':
|
'style:text-properties':
|
||||||
TsSpreadOpenDocReader(Reader).ReadFont(AStyleNode, ATitle.Font);
|
GetChartTextProps(AStyleNode, ATitle.Font);
|
||||||
end;
|
end;
|
||||||
AStyleNode := AStyleNode.NextSibling;
|
AStyleNode := AStyleNode.NextSibling;
|
||||||
end;
|
end;
|
||||||
|
@ -1906,7 +1906,7 @@ begin
|
|||||||
TextFormat(tfHtml).
|
TextFormat(tfHtml).
|
||||||
Get;
|
Get;
|
||||||
if AWorkbookSeries.Regression.DisplayRSquare then
|
if AWorkbookSeries.Regression.DisplayRSquare then
|
||||||
s := s + LineEnding + 'R² = ' + FormatFloat('0.00', ser.FitStatistics.R2);
|
s := s + LineEnding + 'R<sup>2</sup> = ' + FormatFloat('0.00', ser.FitStatistics.R2);
|
||||||
if s <> '' then
|
if s <> '' then
|
||||||
ser.Title := ser.Title + LineEnding + s;
|
ser.Title := ser.Title + LineEnding + s;
|
||||||
// ser.Legend.Format := '%0:s' + LineEnding + '%2:s';
|
// ser.Legend.Format := '%0:s' + LineEnding + '%2:s';
|
||||||
|
Loading…
Reference in New Issue
Block a user