Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
9408a1d0
Kaydet (Commit)
9408a1d0
authored
Tem 02, 2013
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Draw MeanValue in chart bounds, smarter define no. of curve points.
Change-Id: Ida8006af7f2771ee5f2c425d5c72df4cdba827b5
üst
95314b1f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
28 deletions
+42
-28
VSeriesPlotter.cxx
chart2/source/view/charttypes/VSeriesPlotter.cxx
+42
-28
No files found.
chart2/source/view/charttypes/VSeriesPlotter.cxx
Dosyayı görüntüle @
9408a1d0
...
...
@@ -966,22 +966,26 @@ void VSeriesPlotter::createErrorBar_Y( const drawing::Position3D& rUnscaledLogic
void
VSeriesPlotter
::
createRegressionCurvesShapes
(
VDataSeries
&
rVDataSeries
,
const
uno
::
Reference
<
drawing
::
XShapes
>&
xTarget
,
const
uno
::
Reference
<
drawing
::
XShapes
>&
xEquationTarget
,
bool
bMaySkipPoints
InRegressionCalculation
)
bool
bMaySkipPoints
)
{
if
(
m_nDimension
!=
2
)
return
;
uno
::
Reference
<
XRegressionCurveContainer
>
xRegressionContainer
(
rVDataSeries
.
getModel
(),
uno
::
UNO_QUERY
);
if
(
!
xRegressionContainer
.
is
())
uno
::
Reference
<
XRegressionCurveContainer
>
xContainer
(
rVDataSeries
.
getModel
(),
uno
::
UNO_QUERY
);
if
(
!
xContainer
.
is
())
return
;
uno
::
Sequence
<
uno
::
Reference
<
XRegressionCurve
>
>
aCurveList
=
xRegressionContainer
->
getRegressionCurves
();
uno
::
Sequence
<
uno
::
Reference
<
XRegressionCurve
>
>
aCurveList
=
xContainer
->
getRegressionCurves
();
for
(
sal_Int32
nN
=
0
;
nN
<
aCurveList
.
getLength
();
nN
++
)
{
uno
::
Reference
<
XRegressionCurveCalculator
>
xCalculator
(
aCurveList
[
nN
]
->
getCalculator
()
);
if
(
!
xCalculator
.
is
())
continue
;
uno
::
Reference
<
beans
::
XPropertySet
>
xProperties
(
aCurveList
[
nN
],
uno
::
UNO_QUERY
);
bool
bAverageLine
=
RegressionCurveHelper
::
isMeanValueLine
(
aCurveList
[
nN
]
);
sal_Int32
aDegree
=
2
;
sal_Int32
aPeriod
=
2
;
double
aExtrapolateForward
=
0.0
;
...
...
@@ -989,7 +993,7 @@ void VSeriesPlotter::createRegressionCurvesShapes( VDataSeries& rVDataSeries,
sal_Bool
aForceIntercept
=
false
;
double
aInterceptValue
=
0.0
;
if
(
xProperties
.
is
()
)
if
(
xProperties
.
is
()
&&
!
bAverageLine
)
{
xProperties
->
getPropertyValue
(
"PolynomialDegree"
)
>>=
aDegree
;
xProperties
->
getPropertyValue
(
"MovingAveragePeriod"
)
>>=
aPeriod
;
...
...
@@ -1000,29 +1004,40 @@ void VSeriesPlotter::createRegressionCurvesShapes( VDataSeries& rVDataSeries,
xProperties
->
getPropertyValue
(
"InterceptValue"
)
>>=
aInterceptValue
;
}
uno
::
Reference
<
XRegressionCurveCalculator
>
xRegressionCurveCalculator
(
aCurveList
[
nN
]
->
getCalculator
()
);
if
(
!
xRegressionCurveCalculator
.
is
())
continue
;
double
fMinX
;
double
fMaxX
;
rVDataSeries
.
getMinMaxXValue
(
fMinX
,
fMaxX
);
fMaxX
+=
aExtrapolateForward
;
fMinX
-=
aExtrapolateBackward
;
double
fChartMinX
=
m_pPosHelper
->
getLogicMinX
();
double
fChartMaxX
=
m_pPosHelper
->
getLogicMaxX
();
xRegressionCurveCalculator
->
setRegressionProperties
(
aDegree
,
aForceIntercept
,
aInterceptValue
,
aPeriod
);
xRegressionCurveCalculator
->
recalculateRegression
(
rVDataSeries
.
getAllX
(),
rVDataSeries
.
getAllY
()
);
double
fPointScale
=
1.0
;
if
(
bAverageLine
)
{
fMinX
=
fChartMinX
;
fMaxX
=
fChartMaxX
;
}
else
{
rVDataSeries
.
getMinMaxXValue
(
fMinX
,
fMaxX
);
fMaxX
+=
aExtrapolateForward
;
fMinX
-=
aExtrapolateBackward
;
fPointScale
=
(
fMaxX
-
fMinX
)
/
(
fChartMaxX
-
fChartMinX
);
}
xCalculator
->
setRegressionProperties
(
aDegree
,
aForceIntercept
,
aInterceptValue
,
aPeriod
);
xCalculator
->
recalculateRegression
(
rVDataSeries
.
getAllX
(),
rVDataSeries
.
getAllY
()
);
sal_Int32
nPointCount
=
100
*
fPointScale
;
sal_Int32
nRegressionPointCount
=
100
;
//@todo find a more optimal solution if more complicated curve types are introduced
drawing
::
PolyPolygonShape3D
aRegressionPoly
;
aRegressionPoly
.
SequenceX
.
realloc
(
1
);
aRegressionPoly
.
SequenceY
.
realloc
(
1
);
aRegressionPoly
.
SequenceZ
.
realloc
(
1
);
aRegressionPoly
.
SequenceX
[
0
].
realloc
(
n
Regression
PointCount
);
aRegressionPoly
.
SequenceY
[
0
].
realloc
(
n
Regression
PointCount
);
aRegressionPoly
.
SequenceZ
[
0
].
realloc
(
n
Regression
PointCount
);
aRegressionPoly
.
SequenceX
[
0
].
realloc
(
nPointCount
);
aRegressionPoly
.
SequenceY
[
0
].
realloc
(
nPointCount
);
aRegressionPoly
.
SequenceZ
[
0
].
realloc
(
nPointCount
);
sal_Int32
nRealPointCount
=
0
;
std
::
vector
<
ExplicitScaleData
>
aScales
(
m_pPosHelper
->
getScales
());
...
...
@@ -1035,16 +1050,15 @@ void VSeriesPlotter::createRegressionCurvesShapes( VDataSeries& rVDataSeries,
}
uno
::
Sequence
<
geometry
::
RealPoint2D
>
aCalculatedPoints
(
xRegressionCurveCalculator
->
getCurveValues
(
fMinX
,
fMaxX
,
nRegressionPointCount
,
xScalingX
,
xScalingY
,
bMaySkipPointsInRegressionCalculation
));
nRegressionPointCount
=
aCalculatedPoints
.
getLength
();
bool
bAverageLine
=
RegressionCurveHelper
::
isMeanValueLine
(
aCurveList
[
nN
]
);
xCalculator
->
getCurveValues
(
fMinX
,
fMaxX
,
nPointCount
,
xScalingX
,
xScalingY
,
bMaySkipPoints
));
for
(
sal_Int32
nP
=
0
;
nP
<
nRegressionPointCount
;
nP
++
)
for
(
sal_Int32
nP
=
0
;
nP
<
aCalculatedPoints
.
getLength
()
;
nP
++
)
{
double
fLogicX
=
aCalculatedPoints
[
nP
].
X
;
double
fLogicY
=
aCalculatedPoints
[
nP
].
Y
;
double
fLogicZ
=
0.0
;
//dummy
double
fLogicZ
=
0.0
;
//dummy
// fdo#51656: don't scale mean value lines
if
(
!
bAverageLine
)
...
...
@@ -1089,7 +1103,7 @@ void VSeriesPlotter::createRegressionCurvesShapes( VDataSeries& rVDataSeries,
{
createRegressionCurveEquationShapes
(
rVDataSeries
.
getDataCurveEquationCID
(
nN
),
xEquationProperties
,
xEquationTarget
,
x
RegressionCurve
Calculator
,
xEquationProperties
,
xEquationTarget
,
xCalculator
,
aDefaultPos
);
}
}
...
...
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