Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
magicseteditor
Commits
56abe556
Commit
56abe556
authored
Dec 28, 2008
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some more minor graph tweaks
parent
02545485
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
+12
-11
src/gui/control/graph.cpp
src/gui/control/graph.cpp
+12
-11
No files found.
src/gui/control/graph.cpp
View file @
56abe556
...
@@ -578,14 +578,16 @@ void ScatterGraph::draw(RotatedDC& dc, const vector<int>& current, DrawLayer lay
...
@@ -578,14 +578,16 @@ void ScatterGraph::draw(RotatedDC& dc, const vector<int>& current, DrawLayer lay
int
y
=
0
;
int
y
=
0
;
FOR_EACH_CONST
(
g2
,
axis2
.
groups
)
{
FOR_EACH_CONST
(
g2
,
axis2
.
groups
)
{
UInt
value
=
values
[
i
++
];
UInt
value
=
values
[
i
++
];
Color
color
=
lerp
(
fg
,
lerp
(
g1
.
color
,
g2
.
color
,
0.5
-
(
axis1
.
auto_color
==
AUTO_COLOR_NO
?
0.35
:
0.0
)
+
(
axis2
.
auto_color
==
AUTO_COLOR_NO
?
0.35
:
0.0
)),
0.5
+
(
axis1
.
auto_color
==
AUTO_COLOR_NO
||
axis2
.
auto_color
==
AUTO_COLOR_NO
?
0.5
:
0.0
));
if
(
value
>
0
)
{
bool
active
=
!
(
cur1
==
-
1
&&
cur2
==
-
1
)
&&
(
x
==
cur1
||
cur1
==
-
1
)
&&
(
y
==
cur2
||
cur2
==
-
1
);
Color
color
=
lerp
(
fg
,
lerp
(
g1
.
color
,
g2
.
color
,
0.5
-
(
axis1
.
auto_color
==
AUTO_COLOR_NO
?
0.35
:
0.0
)
+
(
axis2
.
auto_color
==
AUTO_COLOR_NO
?
0.35
:
0.0
)),
0.5
+
(
axis1
.
auto_color
==
AUTO_COLOR_NO
||
axis2
.
auto_color
==
AUTO_COLOR_NO
?
0.5
:
0.0
));
dc
.
SetPen
(
active
?
fg
:
lerp
(
fg
,
color
,
0.5
));
bool
active
=
!
(
cur1
==
-
1
&&
cur2
==
-
1
)
&&
(
x
==
cur1
||
cur1
==
-
1
)
&&
(
y
==
cur2
||
cur2
==
-
1
);
dc
.
SetBrush
(
color
);
dc
.
SetPen
(
active
?
fg
:
lerp
(
fg
,
color
,
0.5
));
double
radius
=
floor
(
scale
(
value
)
*
step
-
0.5
)
*
2
+
1
;
// always odd
dc
.
SetBrush
(
color
);
double
xx
=
rect
.
left
()
+
(
x
+
0.5
)
*
size
.
width
+
0.5
;
double
radius
=
floor
(
scale
(
value
)
*
step
-
0.5
)
*
2
+
1
;
// always odd
double
yy
=
rect
.
bottom
()
-
(
y
+
0.5
)
*
size
.
height
+
0.5
;
double
xx
=
rect
.
left
()
+
(
x
+
0.5
)
*
size
.
width
+
0.5
;
dc
.
DrawEllipse
(
RealPoint
(
xx
,
yy
),
RealSize
(
radius
,
radius
));
double
yy
=
rect
.
bottom
()
-
(
y
+
0.5
)
*
size
.
height
+
0.5
;
dc
.
DrawEllipse
(
RealPoint
(
xx
,
yy
),
RealSize
(
radius
,
radius
));
}
++
y
;
++
y
;
}
}
++
x
;
++
x
;
...
@@ -627,7 +629,7 @@ void ScatterGraph::setData(const GraphDataP& d) {
...
@@ -627,7 +629,7 @@ void ScatterGraph::setData(const GraphDataP& d) {
// find maximum (x)
// find maximum (x)
size_t
n1
=
axis1_data
().
groups
.
size
();
size_t
n1
=
axis1_data
().
groups
.
size
();
size_t
n2
=
axis2_data
().
groups
.
size
();
size_t
n2
=
axis2_data
().
groups
.
size
();
double
allow_overlap_x
=
axis1_data
().
numeric
?
0.
85
:
1
;
double
allow_overlap_x
=
axis1_data
().
numeric
?
0.
9
:
1
;
// it is okay if we get a bit of a blob on a numeric axis
max_value_x
=
0
;
max_value_x
=
0
;
for
(
size_t
y
=
0
;
y
<
n2
;
++
y
)
{
for
(
size_t
y
=
0
;
y
<
n2
;
++
y
)
{
max_value_x
=
max
(
max_value_x
,
2
*
scale
(
values
[
y
]));
// left border
max_value_x
=
max
(
max_value_x
,
2
*
scale
(
values
[
y
]));
// left border
...
@@ -638,7 +640,7 @@ void ScatterGraph::setData(const GraphDataP& d) {
...
@@ -638,7 +640,7 @@ void ScatterGraph::setData(const GraphDataP& d) {
max_value_x
=
max
(
max_value_x
,
2
*
scale
(
values
[(
n1
-
1
)
*
n2
+
y
]));
// right border
max_value_x
=
max
(
max_value_x
,
2
*
scale
(
values
[(
n1
-
1
)
*
n2
+
y
]));
// right border
}
}
// find maximum (y)
// find maximum (y)
double
allow_overlap_y
=
axis2_data
().
numeric
?
0.
85
:
1
;
double
allow_overlap_y
=
axis2_data
().
numeric
?
0.
9
:
1
;
max_value_y
=
0
;
max_value_y
=
0
;
for
(
size_t
x
=
0
;
x
<
n1
;
++
x
)
{
for
(
size_t
x
=
0
;
x
<
n1
;
++
x
)
{
max_value_y
=
max
(
max_value_y
,
2
*
scale
(
values
[
x
*
n2
]));
// top border
max_value_y
=
max
(
max_value_y
,
2
*
scale
(
values
[
x
*
n2
]));
// top border
...
@@ -673,7 +675,6 @@ void ScatterPieGraph::draw(RotatedDC& dc, const vector<int>& current, DrawLayer
...
@@ -673,7 +675,6 @@ void ScatterPieGraph::draw(RotatedDC& dc, const vector<int>& current, DrawLayer
int
cur1
=
this
->
axis1
<
current
.
size
()
?
current
[
this
->
axis1
]
:
-
1
;
int
cur1
=
this
->
axis1
<
current
.
size
()
?
current
[
this
->
axis1
]
:
-
1
;
int
cur2
=
this
->
axis2
<
current
.
size
()
?
current
[
this
->
axis2
]
:
-
1
;
int
cur2
=
this
->
axis2
<
current
.
size
()
?
current
[
this
->
axis2
]
:
-
1
;
RealSize
size
(
rect
.
width
/
axis1
.
groups
.
size
(),
rect
.
height
/
axis2
.
groups
.
size
());
// size for a single cell
RealSize
size
(
rect
.
width
/
axis1
.
groups
.
size
(),
rect
.
height
/
axis2
.
groups
.
size
());
// size for a single cell
//%%double step = min(size.width, size.height) / scale(max_value) / 2.01;
double
step
=
min
(
size
.
width
/
max_value_x
,
size
.
height
/
max_value_y
)
*
0.99
;
double
step
=
min
(
size
.
width
/
max_value_x
,
size
.
height
/
max_value_y
)
*
0.99
;
// Draw pies
// Draw pies
Color
fg
=
wxSystemSettings
::
GetColour
(
wxSYS_COLOUR_WINDOWTEXT
);
Color
fg
=
wxSystemSettings
::
GetColour
(
wxSYS_COLOUR_WINDOWTEXT
);
...
...
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