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
381413b4
Commit
381413b4
authored
8 years ago
by
Tim Molter
Browse files
Options
Downloads
Patches
Plain Diff
real-time bubble chart
parent
b86296fb
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-demo/src/main/java/org/knowm/xchart/demo/XChartDemo.java
+19
-0
19 additions, 0 deletions
...-demo/src/main/java/org/knowm/xchart/demo/XChartDemo.java
with
19 additions
and
0 deletions
xchart-demo/src/main/java/org/knowm/xchart/demo/XChartDemo.java
+
19
−
0
View file @
381413b4
...
...
@@ -67,6 +67,7 @@ import org.knowm.xchart.demo.charts.pie.PieChart04;
import
org.knowm.xchart.demo.charts.realtime.RealtimeChart01
;
import
org.knowm.xchart.demo.charts.realtime.RealtimeChart02
;
import
org.knowm.xchart.demo.charts.realtime.RealtimeChart03
;
import
org.knowm.xchart.demo.charts.realtime.RealtimeChart04
;
import
org.knowm.xchart.demo.charts.scatter.ScatterChart01
;
import
org.knowm.xchart.demo.charts.scatter.ScatterChart02
;
import
org.knowm.xchart.demo.charts.scatter.ScatterChart03
;
...
...
@@ -96,6 +97,7 @@ public class XChartDemo extends JPanel implements TreeSelectionListener {
final
RealtimeChart01
realtimeChart01
=
new
RealtimeChart01
();
final
RealtimeChart02
realtimeChart02
=
new
RealtimeChart02
();
final
RealtimeChart03
realtimeChart03
=
new
RealtimeChart03
();
final
RealtimeChart04
realtimeChart04
=
new
RealtimeChart04
();
Timer
timer
=
new
Timer
();
/**
...
...
@@ -197,6 +199,20 @@ public class XChartDemo extends JPanel implements TreeSelectionListener {
timer
=
new
Timer
();
timer
.
scheduleAtFixedRate
(
chartUpdaterTask
,
0
,
500
);
}
else
if
(
chartInfo
.
getExampleChartName
().
startsWith
(
"RealtimeChart04"
))
{
// set up real-time chart simulated data feed
TimerTask
chartUpdaterTask
=
new
TimerTask
()
{
@Override
public
void
run
()
{
realtimeChart04
.
updateData
();
chartPanel
.
updateSeries
(
RealtimeChart02
.
SERIES_NAME
,
null
,
realtimeChart04
.
getyData
(),
realtimeChart04
.
getbubbleData
());
}
};
timer
=
new
Timer
();
timer
.
scheduleAtFixedRate
(
chartUpdaterTask
,
0
,
500
);
}
}
}
...
...
@@ -381,6 +397,9 @@ public class XChartDemo extends JPanel implements TreeSelectionListener {
defaultMutableTreeNode
=
new
DefaultMutableTreeNode
(
new
ChartInfo
(
"RealtimeChart03 - Updating With Error Bars"
,
realtimeChart03
.
getChart
()));
category
.
add
(
defaultMutableTreeNode
);
defaultMutableTreeNode
=
new
DefaultMutableTreeNode
(
new
ChartInfo
(
"RealtimeChart04 - Real-time Bubble Chart"
,
realtimeChart04
.
getChart
()));
category
.
add
(
defaultMutableTreeNode
);
}
/**
...
...
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