release 1.01 修复chart图的一些bug

This commit is contained in:
csh
2022-12-23 10:47:34 +08:00
parent 0b4a534b71
commit 318d4ba97e
5 changed files with 106 additions and 108 deletions
+39 -26
View File
@@ -1095,6 +1095,7 @@ type TChartImpl=class(NodeInfo)
,("field":"Legend","name":Legend.NodeName,"obj":Legend,"attrEx":"","nodeType":"","attrName":"", "desc":"disable", "class":"TLegend")
,("field":"Plotarea","name":Plotarea.NodeName,"obj":Plotarea,"attrEx":"","nodeType":"","attrName":"", "desc":"disable", "class":"TplotArea")
,("field":"ShowBlanksAs","name":"ShowBlanksAs","obj":ShowBlanksAs,"attrEx":"","nodeType":"","attrName":"", "desc":"此元素指定如何在图表上绘制空白单元格。", "class":"")
,("field":"plotVisOnly","name":"plotVisOnly","obj":plotVisOnly,"attrEx":"","nodeType":"","attrName":"", "desc":"此元素指定如何在图表上绘制空白单元格。", "class":"")
,("field":"ChartNode","name":"ChartNode","obj":ChartNode,"attrEx":"","nodeType":"","attrName":"", "desc":"disable", "class":"")
,("field":"C","name":"C","obj":C,"attrEx":"","nodeType":"","attrName":"", "desc":"disable", "class":"")
,("field":"xmlObj","name":"xmlObj","obj":xmlObj,"attrEx":"","nodeType":"","attrName":"", "desc":"disable", "class":"")
@@ -1130,6 +1131,7 @@ type TChartImpl=class(NodeInfo)
Legend;
Plotarea;
ShowBlanksAs;
plotVisOnly;
ChartNode;
C;
xmlObj;
@@ -3005,8 +3007,8 @@ type TView3D=class(NodeInfo)
Function GetChildren(); override;
Begin
HandleChildren();
return array(("field":"RotX","name":"c:rotX","obj":RotX,"attrEx":"rgb","nodeType":"","attrName":"", "desc":"", "class":"")
,("field":"RotY","name":"c:rotY","obj":RotY,"attrEx":"index","nodeType":"","attrName":"", "desc":"", "class":"")
return array(("field":"RotX","name":"c:rotX","obj":RotX,"attrEx":"","nodeType":"","attrName":"", "desc":"", "class":"")
,("field":"RotY","name":"c:rotY","obj":RotY,"attrEx":"","nodeType":"","attrName":"", "desc":"", "class":"")
,("field":"RAngAx","name":"c:rAngAx","obj":RAngAx,"attrEx":"","nodeType":"","attrName":"", "desc":"", "class":"")
,("field":"DepthPercent","name":"c:depthPercent","obj":DepthPercent,"attrEx":"","nodeType":"","attrName":"", "desc":"", "class":"")
,("field":"Perspective","name":"c:perspective","obj":Perspective,"attrEx":"","nodeType":"","attrName":"", "desc":"", "class":"")
@@ -8772,10 +8774,11 @@ Type TChart = Class(TChartImpl)
Serialize();
//以下数据不更新,只更新Series
Plotarea.Layout := nil;
Plotarea.CatAx := nil;
Plotarea.ValAx := nil;
Plotarea.SerAx := nil;
Plotarea.SpPr := nil;
Plotarea.CatAx := new TcAxs(Plotarea, 'c:catAx');
Plotarea.ValAx := new TcAxs(Plotarea, 'c:valAx');
Plotarea.SerAx := new TcAxs(Plotarea, 'c:serAx');
Plotarea.SpPr := new TspPr(Plotarea, 'c:spPr');
tmp := Plotarea.Chart.ExtNodes;
Plotarea.Chart := new TcCharts();
Plotarea.Chart.ExtNodes := tmp;
@@ -8937,7 +8940,7 @@ private
SerAx.AxID := 832256642;
SerAx.Scaling.Max := YAxis.Max;
SerAx.Scaling.Min := YAxis.Min;
CatAx.Scaling.Orientation := YAxis.ReverseOrder ? 'maxMin' : 'minMax';
SerAx.Scaling.Orientation := YAxis.ReverseOrder ? 'maxMin' : 'minMax';
SerAx.Del := YAxis.None;
SerAx.AxPos := XAxis.ReverseOrder ? 't' : 'b';
SerAx.TickLblPos := 'nextTo';
@@ -9179,7 +9182,7 @@ private
setXVal(ser.XVal, i);
setYVal(ser.YVal, i);
setBubbleSize(ser.BubbleSize, i);
setBubble3D(ser.Bubble3D, i);
setBubble3D(ser, i);
End;
o.chart.Ser := SerArr;
End;
@@ -9196,33 +9199,38 @@ private
strRef.strCache.pt.V := name;
End;
Function setBubble3D(Bubble3D, i);
Function setBubble3D(ser, i);
Begin
if Type <> 'bubble3d' then return;
Bubble3D := true;
ser.Bubble3D := true;
End;
Function setBubbleSize(BubbleSize, i);
Begin
if not (Type in array('bubble', 'bubble3d')) then return;
BubbleSize.NumRef.F := Series[i]['Values'];
_setVal(BubbleSize, i);
End;
Function setYVal(Val, i);
Begin
if not (Type in array('scatter', 'bubble', 'bubble3d')) then return;
setVal(Val, i);
_setVal(Val, i);
End;
Function setXVal(xVal, i);
Begin
if not (Type in array('scatter')) then return;
setCat(xVal, i);
_setCat(xVal, i);
End;
Function setVal(Val, ind);
Begin
if Type in array('scatter', 'bubble', 'bubble3d') then return;
_setVal(Val, ind);
End;
Function _setVal(Val, ind);
Begin
data := Series[ind]['Values'];
if ifstring(data) then
Val.NumRef.F := data; //excel图表(Sheet1!$C$2:$C$6
@@ -9244,6 +9252,11 @@ private
Function setCat(Cat, ind);
Begin
if Type in array('scatter', 'bubble', 'bubble3d') then return;
_setCat(Cat, ind);
End;
Function _setCat(Cat, ind);
Begin
Categories := Series[ind]['Categories'];
if ifstring(Categories) then
cat.StrRef.F := Categories; //excel图表(Sheet1!$B$2:$B$6
@@ -9419,7 +9432,7 @@ private
'col3dcylinderstacked': 'bar3DChart',
'col3dcylinderpercentstacked': 'bar3DChart',
'bubble': 'bubbleChart',
'bubble3D': 'bubbleChart');
'bubble3d': 'bubbleChart');
return 'c:' $ m[t];
End;
@@ -9439,44 +9452,44 @@ private
m := array(
'area': 'standard',
'areastacked': 'stacked',
'areapercentstacked': 'percentstacked',
'areapercentstacked': 'percentStacked',
'area3d': 'standard',
'area3dstacked': 'stacked',
'area3dpercentstacked': 'percentstacked',
'area3dpercentstacked': 'percentStacked',
'bar': 'clustered',
'barstacked': 'stacked',
'barpercentstacked': 'percentstacked',
'barpercentstacked': 'percentStacked',
'bar3dclustered': 'clustered',
'bar3dstacked': 'stacked',
'bar3dpercentstacked': 'percentstacked',
'bar3dpercentstacked': 'percentStacked',
'bar3dconeclustered': 'clustered',
'bar3dconestacked': 'stacked',
'bar3dconepercentstacked': 'percentstacked',
'bar3dconepercentstacked': 'percentStacked',
'bar3dpyramidclustered': 'clustered',
'bar3dpyramidstacked': 'stacked',
'bar3dpyramidpercentstacked': 'percentstacked',
'bar3dpyramidpercentstacked': 'percentStacked',
'bar3dcylinderclustered': 'clustered',
'bar3dcylinderstacked': 'stacked',
'bar3dcylinderpercentstacked': 'percentstacked',
'bar3dcylinderpercentstacked': 'percentStacked',
'col': 'clustered',
'colstacked': 'stacked',
'colpercentstacked': 'percentstacked',
'colpercentstacked': 'percentStacked',
'col3d': 'standard',
'col3dclustered': 'clustered',
'col3dstacked': 'stacked',
'col3dpercentstacked': 'percentstacked',
'col3dpercentstacked': 'percentStacked',
'col3dcone': 'standard',
'col3dconeclustered': 'clustered',
'col3dconestacked': 'stacked',
'col3dconepercentstacked': 'percentstacked',
'col3dconepercentstacked': 'percentStacked',
'col3dpyramid': 'standard',
'col3dpyramidclustered': 'clustered',
'col3dpyramidstacked': 'stacked',
'col3dpyramidpercentstacked': 'percentstacked',
'col3dpyramidpercentstacked': 'percentStacked',
'col3dcylinder': 'standard',
'col3dcylinderclustered': 'clustered',
'col3dcylinderstacked': 'stacked',
'col3dcylinderpercentstacked': 'percentstacked',
'col3dcylinderpercentstacked': 'percentStacked',
'line': 'standard');
return m[t];
End;
+2 -2
View File
@@ -12,13 +12,13 @@ Type ErrorMessage = class
class Function SheetExist(sheetName)
Begin
sheetName := ifString(sheetName) ?: '';
sheetName := ifString(sheetName) ?: ' ';
return array(2, sheetName + ' already exists.');
End;
class Function SheetNotExist(sheetName)
Begin
sheetName := ifString(sheetName) ?: '';
sheetName := ifString(sheetName) ?: ' ';
return array(3, sheetName + ' does not exist.');
End;
+1
View File
@@ -104,6 +104,7 @@ Type TSChart = Class
Begin
chartData_.Serialize(IsWord()); //初始化图表数据
task := array(('c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:t', 'pcdata', chartData_.Title),
('c:chartSpace/c:chart/c:plotVisOnly', 'val', chartData_.plotVisOnly),
('c:chartSpace/c:chart/c:dispBlanksAs', 'val', chartData_.ShowBlanksAs),
('c:chartSpace/c:chart/c:legend', 'Del', ifnil(chartData_.Legend)),
('c:chartSpace/c:chart/c:plotArea', 'unmarshal', chartData_.plotArea.Marshal()),
@@ -1,18 +0,0 @@
Type xlsxRichText = Class
file_; //TSExcelFile对象
sheet_;//XmlSheet对象
Function Create(); overload;
Begin
End;
class Function NewObject(sheetname, self);
Begin
file_ := file;
o = file_.WorkBook().GetSheetObj(sheetname);
if not ifObj(o) then return 0;
richTxt := new xlsxRichText();
richTxt.sheet_ = o;
richTxt.file_ := file;
return richTxt;
End;
End;