Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
37b43524
Commit
37b43524
authored
Dec 19, 2016
by
Sergey Luzyanin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
points limit for new chart track
parent
f8493be0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
29 deletions
+91
-29
common/Charts/ChartsDrawer.js
common/Charts/ChartsDrawer.js
+2
-2
common/Drawings/TrackObjects/RotateTracks.js
common/Drawings/TrackObjects/RotateTracks.js
+89
-27
No files found.
common/Charts/ChartsDrawer.js
View file @
37b43524
...
...
@@ -308,9 +308,9 @@ CChartsDrawer.prototype =
}
},
recalculateOnly3dProps
:
function
()
recalculateOnly3dProps
:
function
(
chartSpace
)
{
this
.
cChartSpace
=
chartSpace
;
//
this.cChartSpace = chartSpace;
this
.
calcProp
=
{};
if
(
this
.
_isSwitchCurrent3DChart
(
chartSpace
))
...
...
common/Drawings/TrackObjects/RotateTracks.js
View file @
37b43524
...
...
@@ -599,7 +599,7 @@ function RotateTrackGroup(originalObject)
function
Chart3dAdjustTrack
(
oChartSpace
,
numHandle
,
startX
,
startY
)
{
this
.
chartSpace
=
oChartSpace
;
this
.
numHandle
=
numHandle
;
this
.
originalObject
=
oChartSpace
;
...
...
@@ -612,6 +612,28 @@ function Chart3dAdjustTrack(oChartSpace, numHandle, startX, startY)
this
.
startX
=
oChartSpace
.
invertTransform
.
TransformPointX
(
startX
,
startY
);
this
.
startY
=
oChartSpace
.
invertTransform
.
TransformPointY
(
startX
,
startY
);
this
.
bChartTrack
=
false
;
var
oChartObj
=
oChartSpace
.
chart
.
plotArea
.
charts
[
0
];
if
(
oChartObj
){
var
nPointsCount
=
0
;
if
(
oChartObj
.
getObjectType
()
===
AscDFH
.
historyitem_type_PieChart
||
oChartObj
.
getObjectType
()
===
AscDFH
.
historyitem_type_PieChart
){
if
(
oChartObj
.
series
[
0
]){
nPointsCount
=
AscFormat
.
getPtsFromSeries
(
oChartObj
.
series
[
0
]).
length
;
}
}
else
{
for
(
var
i
=
0
;
i
<
oChartObj
.
series
.
length
;
++
i
){
nPointsCount
+=
AscFormat
.
getPtsFromSeries
(
oChartObj
.
series
[
i
]).
length
;
}
}
if
(
nPointsCount
<
30
){
this
.
bChartTrack
=
true
;
}
}
AscFormat
.
ExecuteNoHistory
(
function
(){
this
.
view3D
=
oChartSpace
.
chart
.
view3D
.
createDuplicate
();
this
.
chartSizes
=
this
.
chartSpace
.
getChartSizes
();
...
...
@@ -633,11 +655,11 @@ function Chart3dAdjustTrack(oChartSpace, numHandle, startX, startY)
var
pxToMM
=
this
.
chartSpace
.
chartObj
.
calcProp
.
pxToMM
;
var
oChSz
=
this
.
chartSizes
;
//
this.centerPoint = this.processor3D.convertAndTurnPoint((oChSz.startX + oChSz.w/2)*pxToMM, (oChSz.startY + oChSz.h/2)*pxToMM, this.depthPerspective/2);
this
.
centerPoint
=
this
.
processor3D
.
convertAndTurnPoint
((
oChSz
.
startX
+
oChSz
.
w
/
2
)
*
pxToMM
,
(
oChSz
.
startY
+
oChSz
.
h
/
2
)
*
pxToMM
,
this
.
depthPerspective
/
2
);
},
this
,
[]);
this
.
draw
=
function
(
overlay
,
transform
)
/*
this.draw = function(overlay, transform)
{
if(AscFormat.isRealNumber(this.chartSpace.selectStartPage) && overlay.SetCurrentPage)
{
...
...
@@ -654,6 +676,46 @@ function Chart3dAdjustTrack(oChartSpace, numHandle, startX, startY)
oChartSpace.chartObj.draw(oChartSpace, graphics);
graphics.RestoreGrState();
}
};*/
this
.
draw
=
function
(
overlay
,
transform
)
{
if
(
this
.
bChartTrack
){
if
(
AscFormat
.
isRealNumber
(
this
.
chartSpace
.
selectStartPage
)
&&
overlay
.
SetCurrentPage
)
{
overlay
.
SetCurrentPage
(
this
.
chartSpace
.
selectStartPage
);
}
var
dOldAlpha
=
null
;
var
oGraphics
=
overlay
.
Graphics
?
overlay
.
Graphics
:
overlay
;
if
(
AscFormat
.
isRealNumber
(
oGraphics
.
globalAlpha
)
&&
oGraphics
.
put_GlobalAlpha
){
var
graphics
=
oGraphics
;
graphics
.
SaveGrState
();
graphics
.
SetIntegerGrid
(
false
);
graphics
.
transform3
(
oChartSpace
.
transform
,
false
);
oChartSpace
.
chartObj
.
draw
(
oChartSpace
,
graphics
);
graphics
.
RestoreGrState
();
}
}
else
{
if
(
AscFormat
.
isRealNumber
(
this
.
chartSpace
.
selectStartPage
)
&&
overlay
.
SetCurrentPage
)
{
overlay
.
SetCurrentPage
(
this
.
chartSpace
.
selectStartPage
);
}
var
dOldAlpha
=
null
;
var
oGraphics
=
overlay
.
Graphics
?
overlay
.
Graphics
:
overlay
;
if
(
AscFormat
.
isRealNumber
(
oGraphics
.
globalAlpha
)
&&
oGraphics
.
put_GlobalAlpha
){
dOldAlpha
=
oGraphics
.
globalAlpha
;
oGraphics
.
put_GlobalAlpha
(
false
,
1
);
}
this
.
objectToDraw
.
draw
(
overlay
,
transform
);
this
.
objectToDraw2
.
draw
(
overlay
,
transform
);
if
(
AscFormat
.
isRealNumber
(
dOldAlpha
)
&&
oGraphics
.
put_GlobalAlpha
){
oGraphics
.
put_GlobalAlpha
(
true
,
dOldAlpha
);
}
}
};
...
...
@@ -669,29 +731,32 @@ function Chart3dAdjustTrack(oChartSpace, numHandle, startX, startY)
var
pxToMM
=
this
.
chartSpace
.
chartObj
.
calcProp
.
pxToMM
;
this
.
geometry
.
pathLst
.
push
(
path
);
var
oChSz
=
this
.
chartSizes
;
var
processor3D
=
this
.
chartSpace
.
chartObj
.
processor3D
;
var
centerPoint2
=
this
.
processor3D
.
convertAndTurnPoint
((
oChSz
.
startX
+
oChSz
.
w
/
2
)
*
pxToMM
,
(
oChSz
.
startY
+
oChSz
.
h
/
2
)
*
pxToMM
,
this
.
depthPerspective
/
2
);
var
deltaX
=
(
this
.
centerPoint
.
x
-
centerPoint2
.
x
)
/
pxToMM
;
var
deltaY
=
(
this
.
centerPoint
.
y
-
centerPoint2
.
y
)
/
pxToMM
;
var
point1
=
this
.
processor3D
.
convertAndTurnPoint
(
oChSz
.
startX
*
pxToMM
,
oChSz
.
startY
*
pxToMM
,
0
);
var
point1
=
processor3D
.
convertAndTurnPoint
(
oChSz
.
startX
*
pxToMM
,
oChSz
.
startY
*
pxToMM
,
0
);
path
.
moveTo
(
point1
.
x
/
pxToMM
+
deltaX
,
point1
.
y
/
pxToMM
+
deltaY
);
var
point2
=
this
.
processor3D
.
convertAndTurnPoint
((
oChSz
.
startX
+
oChSz
.
w
)
*
pxToMM
,
oChSz
.
startY
*
pxToMM
,
0
);
var
point2
=
processor3D
.
convertAndTurnPoint
((
oChSz
.
startX
+
oChSz
.
w
)
*
pxToMM
,
oChSz
.
startY
*
pxToMM
,
0
);
path
.
lnTo
(
point2
.
x
/
pxToMM
+
deltaX
,
point2
.
y
/
pxToMM
+
deltaY
);
var
point3
=
this
.
processor3D
.
convertAndTurnPoint
((
oChSz
.
startX
+
oChSz
.
w
)
*
pxToMM
,
(
oChSz
.
startY
+
oChSz
.
h
)
*
pxToMM
,
0
);
var
point3
=
processor3D
.
convertAndTurnPoint
((
oChSz
.
startX
+
oChSz
.
w
)
*
pxToMM
,
(
oChSz
.
startY
+
oChSz
.
h
)
*
pxToMM
,
0
);
path
.
lnTo
(
point3
.
x
/
pxToMM
+
deltaX
,
point3
.
y
/
pxToMM
+
deltaY
);
var
point4
=
this
.
processor3D
.
convertAndTurnPoint
((
oChSz
.
startX
)
*
pxToMM
,
(
oChSz
.
startY
+
oChSz
.
h
)
*
pxToMM
,
0
);
var
point4
=
processor3D
.
convertAndTurnPoint
((
oChSz
.
startX
)
*
pxToMM
,
(
oChSz
.
startY
+
oChSz
.
h
)
*
pxToMM
,
0
);
path
.
lnTo
(
point4
.
x
/
pxToMM
+
deltaX
,
point4
.
y
/
pxToMM
+
deltaY
);
path
.
close
();
var
point1d
=
this
.
processor3D
.
convertAndTurnPoint
(
oChSz
.
startX
*
pxToMM
,
oChSz
.
startY
*
pxToMM
,
this
.
depthPerspective
);
var
point1d
=
processor3D
.
convertAndTurnPoint
(
oChSz
.
startX
*
pxToMM
,
oChSz
.
startY
*
pxToMM
,
this
.
depthPerspective
);
path
.
moveTo
(
point1d
.
x
/
pxToMM
+
deltaX
,
point1d
.
y
/
pxToMM
+
deltaY
);
var
point2d
=
this
.
processor3D
.
convertAndTurnPoint
((
oChSz
.
startX
+
oChSz
.
w
)
*
pxToMM
,
oChSz
.
startY
*
pxToMM
,
this
.
depthPerspective
);
var
point2d
=
processor3D
.
convertAndTurnPoint
((
oChSz
.
startX
+
oChSz
.
w
)
*
pxToMM
,
oChSz
.
startY
*
pxToMM
,
this
.
depthPerspective
);
path
.
lnTo
(
point2d
.
x
/
pxToMM
+
deltaX
,
point2d
.
y
/
pxToMM
+
deltaY
);
var
point3d
=
this
.
processor3D
.
convertAndTurnPoint
((
oChSz
.
startX
+
oChSz
.
w
)
*
pxToMM
,
(
oChSz
.
startY
+
oChSz
.
h
)
*
pxToMM
,
this
.
depthPerspective
);
var
point3d
=
processor3D
.
convertAndTurnPoint
((
oChSz
.
startX
+
oChSz
.
w
)
*
pxToMM
,
(
oChSz
.
startY
+
oChSz
.
h
)
*
pxToMM
,
this
.
depthPerspective
);
path
.
lnTo
(
point3d
.
x
/
pxToMM
+
deltaX
,
point3d
.
y
/
pxToMM
+
deltaY
);
var
point4d
=
this
.
processor3D
.
convertAndTurnPoint
((
oChSz
.
startX
)
*
pxToMM
,
(
oChSz
.
startY
+
oChSz
.
h
)
*
pxToMM
,
this
.
depthPerspective
);
var
point4d
=
processor3D
.
convertAndTurnPoint
((
oChSz
.
startX
)
*
pxToMM
,
(
oChSz
.
startY
+
oChSz
.
h
)
*
pxToMM
,
this
.
depthPerspective
);
path
.
lnTo
(
point4d
.
x
/
pxToMM
+
deltaX
,
point4d
.
y
/
pxToMM
+
deltaY
);
path
.
close
();
...
...
@@ -775,23 +840,20 @@ function Chart3dAdjustTrack(oChartSpace, numHandle, startX, startY)
this
.
view3D
.
rotX
=
90
;
}
var
OldView
=
oChartSpace
.
chart
.
view3D
;
oChartSpace
.
chart
.
view3D
=
this
.
view3D
;
oChartSpace
.
recalcInfo
.
recalculateChart
=
true
;
oChartSpace
.
recalculate
();
oChartSpace
.
chart
.
view3D
=
OldView
;
return
;
this
.
processor3D
.
angleOx
=
this
.
view3D
&&
this
.
view3D
.
rotX
?
(
-
this
.
view3D
.
rotX
/
360
)
*
(
Math
.
PI
*
2
)
:
0
;
this
.
processor3D
.
angleOy
=
this
.
view3D
&&
this
.
view3D
.
rotY
?
(
-
this
.
view3D
.
rotY
/
360
)
*
(
Math
.
PI
*
2
)
:
0
;
this
.
processor3D
.
angleOz
=
0
;
// this.processor3D.view3D = this.view3D;
// this.processor3D.calaculate3DProperties();
//this.processor3D.view3D = oChartSpace.chart.view3D;
//this.calculateGeometry();
var
OldView
=
oChartSpace
.
chart
.
view3D
;
if
(
this
.
bChartTrack
){
oChartSpace
.
chart
.
view3D
=
this
.
view3D
;
oChartSpace
.
recalcInfo
.
recalculateChart
=
true
;
oChartSpace
.
recalculate
();
oChartSpace
.
chart
.
view3D
=
OldView
;
}
else
{
oChartSpace
.
chart
.
view3D
=
this
.
view3D
;
oChartSpace
.
chartObj
.
recalculateOnly3dProps
(
oChartSpace
);
oChartSpace
.
chart
.
view3D
=
OldView
;
this
.
calculateGeometry
();
}
};
this
.
trackEnd
=
function
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment