Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
XChart
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Brady James Garvin
XChart
Commits
7c7b994d
Commit
7c7b994d
authored
11 years ago
by
Tim Molter
Browse files
Options
Downloads
Patches
Plain Diff
fix custom min and max for log plots
parent
ccaac8b0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
xchart/src/main/java/com/xeiam/xchart/internal/chartpart/AxisTickLogarithmicCalculator.java
+17
-1
17 additions, 1 deletion
...art/internal/chartpart/AxisTickLogarithmicCalculator.java
with
17 additions
and
1 deletion
xchart/src/main/java/com/xeiam/xchart/internal/chartpart/AxisTickLogarithmicCalculator.java
+
17
−
1
View file @
7c7b994d
...
...
@@ -66,9 +66,26 @@ public class AxisTickLogarithmicCalculator extends AxisTickCalculator {
// where the tick should begin in the working space in pixels
int
margin
=
AxisPair
.
getTickStartOffset
(
workingSpace
,
tickSpace
);
// in plot space BigDecimal gridStep = getGridStepForDecimal(tickSpace);
if
(
axisDirection
==
Direction
.
Y
&&
styleManager
.
getXAxisMin
()
==
null
)
{
}
int
logMin
=
(
int
)
Math
.
floor
(
Math
.
log10
(
minValue
.
doubleValue
()));
int
logMax
=
(
int
)
Math
.
ceil
(
Math
.
log10
(
maxValue
.
doubleValue
()));
if
(
axisDirection
==
Direction
.
Y
&&
styleManager
.
getYAxisMin
()
!=
null
)
{
logMin
=
(
int
)
(
Math
.
log10
(
styleManager
.
getYAxisMin
()));
// no floor
}
if
(
axisDirection
==
Direction
.
Y
&&
styleManager
.
getYAxisMax
()
!=
null
)
{
logMax
=
(
int
)
(
Math
.
log10
(
styleManager
.
getYAxisMax
()));
// no floor
}
if
(
axisDirection
==
Direction
.
X
&&
styleManager
.
getXAxisMin
()
!=
null
)
{
logMin
=
(
int
)
(
Math
.
log10
(
styleManager
.
getXAxisMin
()));
// no floor
}
if
(
axisDirection
==
Direction
.
X
&&
styleManager
.
getXAxisMax
()
!=
null
)
{
logMax
=
(
int
)
(
Math
.
log10
(
styleManager
.
getXAxisMax
()));
// no floor
}
final
BigDecimal
min
=
new
BigDecimal
(
minValue
.
doubleValue
());
BigDecimal
tickStep
=
pow
(
10
,
logMin
-
1
);
...
...
@@ -99,5 +116,4 @@ public class AxisTickLogarithmicCalculator extends AxisTickCalculator {
firstPosition
=
tickStep
.
add
(
pow
(
10
,
i
));
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment