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
8436388f
Commit
8436388f
authored
11 years ago
by
Tim Molter
Browse files
Options
Downloads
Patches
Plain Diff
JavaDocs
parent
04fc13f4
No related branches found
Branches containing commit
No related tags found
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/CSVExporter.java
+17
-0
17 additions, 0 deletions
xchart/src/main/java/com/xeiam/xchart/CSVExporter.java
xchart/src/main/java/com/xeiam/xchart/CSVImporter.java
+14
-0
14 additions, 0 deletions
xchart/src/main/java/com/xeiam/xchart/CSVImporter.java
with
31 additions
and
0 deletions
xchart/src/main/java/com/xeiam/xchart/CSVExporter.java
+
17
−
0
View file @
8436388f
...
...
@@ -22,6 +22,12 @@ import java.util.Iterator;
*/
public
class
CSVExporter
{
/**
* Write a Chart series as rows in a CSV file.
*
* @param series
* @param path2Dir - ex. "./path/to/directory/" *make sure you have the '/' on the end
*/
public
static
void
writeCSVRows
(
Series
series
,
String
path2Dir
)
{
File
newFile
=
new
File
(
path2Dir
+
series
.
getName
()
+
".csv"
);
...
...
@@ -48,6 +54,12 @@ public class CSVExporter {
}
}
/**
* Write a Chart series as columns in a CSV file.
*
* @param series
* @param path2Dir - ex. "./path/to/directory/" *make sure you have the '/' on the end
*/
public
static
void
writeCSVColumns
(
Series
series
,
String
path2Dir
)
{
File
newFile
=
new
File
(
path2Dir
+
series
.
getName
()
+
".csv"
);
...
...
@@ -81,6 +93,11 @@ public class CSVExporter {
}
/**
* @param collection
* @param separator
* @return
*/
private
static
String
join
(
Collection
<?
extends
Object
>
collection
,
String
separator
)
{
if
(
collection
==
null
)
{
...
...
This diff is collapsed.
Click to expand it.
xchart/src/main/java/com/xeiam/xchart/CSVImporter.java
+
14
−
0
View file @
8436388f
...
...
@@ -92,6 +92,12 @@ public class CSVImporter {
return
getChartFromCSVDir
(
path2Directory
,
dataOrientation
,
width
,
height
,
null
);
}
/**
* Get the series's data from a file
*
* @param csvFile
* @return
*/
private
static
String
[]
getSeriesDataFromCSVRows
(
File
csvFile
)
{
String
[]
xAndYData
=
new
String
[
2
];
...
...
@@ -119,6 +125,10 @@ public class CSVImporter {
return
xAndYData
;
}
/**
* @param csvFile
* @return
*/
private
static
String
[]
getSeriesDataFromCSVColumns
(
File
csvFile
)
{
String
[]
xAndYData
=
new
String
[
2
];
...
...
@@ -149,6 +159,10 @@ public class CSVImporter {
return
xAndYData
;
}
/**
* @param stringData
* @return
*/
private
static
List
<
Number
>
getAxisData
(
String
stringData
)
{
List
<
Number
>
axisData
=
new
ArrayList
<
Number
>();
...
...
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