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
f37617da
Commit
f37617da
authored
10 years ago
by
Tim Molter
Browse files
Options
Downloads
Plain Diff
Merge pull request #96 from hwaipy/develop
BUG-FIX Histogram
parents
b05a0f3a
8ceadc51
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
xchart/src/main/java/com/xeiam/xchart/Histogram.java
+1
-1
1 addition, 1 deletion
xchart/src/main/java/com/xeiam/xchart/Histogram.java
xchart/src/test/java/com/xeiam/xchart/HistogramTest.java
+10
-2
10 additions, 2 deletions
xchart/src/test/java/com/xeiam/xchart/HistogramTest.java
with
11 additions
and
3 deletions
xchart/src/main/java/com/xeiam/xchart/Histogram.java
+
1
−
1
View file @
f37617da
...
@@ -45,7 +45,7 @@ public class Histogram {
...
@@ -45,7 +45,7 @@ public class Histogram {
this
.
numBins
=
numBins
;
this
.
numBins
=
numBins
;
this
.
originalData
=
data
;
this
.
originalData
=
data
;
Double
tempMax
=
Double
.
M
IN
_VALUE
;
Double
tempMax
=
-
Double
.
M
AX
_VALUE
;
Double
tempMin
=
Double
.
MAX_VALUE
;
Double
tempMin
=
Double
.
MAX_VALUE
;
for
(
Number
number
:
data
)
{
for
(
Number
number
:
data
)
{
double
value
=
number
.
doubleValue
();
double
value
=
number
.
doubleValue
();
...
...
This diff is collapsed.
Click to expand it.
xchart/src/test/java/com/xeiam/xchart/HistogramTest.java
+
10
−
2
View file @
f37617da
...
@@ -16,9 +16,7 @@
...
@@ -16,9 +16,7 @@
package
com.xeiam.xchart
;
package
com.xeiam.xchart
;
import
static
org
.
fest
.
assertions
.
api
.
Assertions
.
assertThat
;
import
static
org
.
fest
.
assertions
.
api
.
Assertions
.
assertThat
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
org.junit.Test
;
import
org.junit.Test
;
/**
/**
...
@@ -39,6 +37,16 @@ public class HistogramTest {
...
@@ -39,6 +37,16 @@ public class HistogramTest {
// Chart chart = new ChartBuilder().chartType(ChartType.Bar).width(800).height(600).build();
// Chart chart = new ChartBuilder().chartType(ChartType.Bar).width(800).height(600).build();
// chart.addSeries("histogram 1", histogram.getxAxisData(), histogram.getyAxisData());
// chart.addSeries("histogram 1", histogram.getxAxisData(), histogram.getyAxisData());
// new SwingWrapper(chart).displayChart();
// new SwingWrapper(chart).displayChart();
}
@Test
public
void
testNegetiveValues
()
{
Histogram
histogram
=
new
Histogram
(
Arrays
.
asList
(-
1
,
-
2
,
-
3
,
-
4
,
-
5
,
-
6
),
3
);
assertThat
(
histogram
.
getMax
()).
isEqualTo
(-
1
);
assertThat
(
histogram
.
getMin
()).
isEqualTo
(-
6
);
assertThat
(
histogram
.
getNumBins
()).
isEqualTo
(
3
);
}
}
}
}
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