I'm using Google Visualization motion chart to display different reports. One report shows executable lines of code vs. warnings in each file. Following is what the chart looks like. The x-axis represents eloc and the y axis represents warnings in each file. When the chart is loaded, as you can see all the files are represented with blue balls except for one file, it's displayed with a red ball. what does that mean? is that a bug? I've tried looking on line to find explanations but no luck.
Following is my code:
public class DashboardWidget
{
private HorizontalPanel containerPanel=null;
private DataTable data=null;
public DashboardWidget()
{
containerPanel = new HorizontalPanel();
}
public HorizontalPanel getContainerPanel()
{
SQLRunnerAsync service = (SQLRunnerAsync) GWT.create(SQLRunner.class);
AsyncCallback<ArrayList<String[]>> callback = new AsyncCallback<ArrayList<String[]>>()
{
#Override
public void onFailure(Throwable caught)
{
}
#Override
public void onSuccess(final ArrayList<String[]> result)
{
Runnable onLoadCallback = new Runnable()
{
public void run()
{
data = DataTable.create();
data.addColumn(ColumnType.STRING, "Name");
data.addColumn(ColumnType.DATE, "Date");
data.addColumn(ColumnType.NUMBER, "Option1");
data.addColumn(ColumnType.NUMBER, "Option2");
data.addColumn(ColumnType.NUMBER, "Option3");
data.addRows(result.size());
Date date = new Date();
DateTimeFormat fmt = DateTimeFormat.getFormat("MM/dd/yyyy");
Date d1 = fmt.parse(fmt.format(date));
int i;
for(i=0;i<result.size();i++)
{
String[] temp = result.get(i);
String Name=temp[0];//name
String Option1 = temp[1];
String Option2=temp[2];
String Option3=temp[3];
data.setValue(i, 0, Name);//NAME
data.setValue(i, 1, d1);//date
data.setValue(i, 2, Integer.parseInt(Option1));
data.setValue(i, 3, Integer.parseInt(Option2));
data.setValue(i, 4, Integer.parseInt(Option13));
}
Options options = Options.create();
options.setWidth(1000);
options.setHeight(1000);
MotionChart chart = new MotionChart(data, options);
containerPanel.add(chart);
}
};
VisualizationUtils.loadVisualizationApi(onLoadCallback, MotionChart.PACKAGE);
}
};
service.getData("","","","", callback);
return containerPanel;
}
}
Shouldn't
data.setValue(i, 4, Integer.parseInt(Option13));
be
data.setValue(i, 4, Integer.parseInt(Option3));
Related
P.P.S. Ok, I founded hier Javers Comparing Lists following comment
There is no concept of move in JaVers list comparison algorithms. After a move there will be two changes reported: ValueAdded and ValueRemoved, just like you have mentioned.
But how then I can recognize, that the list actually has not been changed?
P.S. Even if I get #Entities and #Id to ZasFish, ZasCatchZone and ZasCatchArea I still get
Diff:
1. NewObject{globalId:'my.javers.comparator.ZasFish/2'}
2. ObjectRemoved{globalId:'my.javers.comparator.ZasFish/1'}
I'm trying to compare lists of custom objects. I set LEVENSHTEIN_DISTANCE and created custom comparators. The only difference between objects is the order of values in the lists. I would expect "no changes", but I got ListChange. The result and example is below. What am I doing wrong?
Many thanks and regards,
Andrej
Diff:
1. ListChange{globalId:'my.javers.comparator.ZasFish/', property:'zones', containerChanges:[(2).'my.javers.comparator.ZasCatchZone#7a9273a8'>>'my.javers.comparator.ZasCatchZone#26a7b76d', (1).'my.javers.comparator.ZasCatchZone#4abdb505'>>'my.javers.comparator.ZasCatchZone#7ce6a65d', (0).'my.javers.comparator.ZasCatchZone#1500955a'>>'my.javers.comparator.ZasCatchZone#e874448']}
2. ListChange{globalId:'my.javers.comparator.ZasFish/', property:'areas', containerChanges:[(2).'my.javers.comparator.ZasCatchArea#7113b13f'>>'my.javers.comparator.ZasCatchArea#45820e51', (1).'my.javers.comparator.ZasCatchArea#42d8062c'>>'my.javers.comparator.ZasCatchArea#6043cd28', (0).'my.javers.comparator.ZasCatchArea#cb51256'>>'my.javers.comparator.ZasCatchArea#59906517']}
package my.javers.comparator;
public class ZasCatchArea {
String catchArea;
public String getCatchArea() {
return catchArea;
}
public void setCatchArea(String catchArea) {
this.catchArea = catchArea;
}
}
public class ZasCatchZone {
String catchZone;
public String getCatchZone() {
return catchZone;
}
public void setCatchZone(String catchZone) {
this.catchZone = catchZone;
}
}
public class ZasFish {
String fischName;
List<ZasCatchZone> zones = new ArrayList<ZasCatchZone>();
List<ZasCatchArea> areas = new ArrayList<ZasCatchArea>();
public String getFischName() {
return fischName;
}
public void setFischName(String fischName) {
this.fischName = fischName;
}
public List<ZasCatchZone> getZones() {
return zones;
}
public void setZones(List<ZasCatchZone> zones) {
this.zones = zones;
}
public List<ZasCatchArea> getAreas() {
return areas;
}
public void setAreas(List<ZasCatchArea> areas) {
this.areas = areas;
}
}
public class ZasCatchAreaComparator implements
CustomPropertyComparator<ZasCatchArea, ValueChange> {
public ValueChange compare(ZasCatchArea left, ZasCatchArea right,
GlobalId affectedCdoId, Property propertyName) {
if (left.getCatchArea().equals(right.getCatchArea()))
return null;
return new ValueChange(affectedCdoId, propertyName.getName(), left, right);
}
}
public class ZasCatchZoneComparator implements
CustomPropertyComparator<ZasCatchZone, ValueChange> {
public ValueChange compare(ZasCatchZone left, ZasCatchZone right,
GlobalId affectedCdoId, Property propertyName) {
if (left.getCatchZone().equals(right.getCatchZone()))
return null;
return new ValueChange(affectedCdoId, propertyName.getName(), left, right);
}
}
public class MyComparator {
public static void main(String[] args) {
Javers javers = JaversBuilder.javers()
.registerCustomComparator(new ZasCatchAreaComparator(), ZasCatchArea.class)
.registerCustomComparator(new ZasCatchZoneComparator(), ZasCatchZone.class)
.withListCompareAlgorithm(ListCompareAlgorithm.LEVENSHTEIN_DISTANCE).build();
ZasFish fisch1 = new ZasFish();
ZasFish fisch2 = new ZasFish();
ZasCatchZone z1 = new ZasCatchZone();
z1.setCatchZone("zone1");
ZasCatchZone z2 = new ZasCatchZone();
z2.setCatchZone("zone2");
ZasCatchZone z3 = new ZasCatchZone();
z3.setCatchZone("zone3");
fisch1.getZones().add(z1);
fisch1.getZones().add(z2);
fisch1.getZones().add(z3);
ZasCatchArea a1 = new ZasCatchArea();
a1.setCatchArea("area1");
ZasCatchArea a2 = new ZasCatchArea();
a2.setCatchArea("area2");
ZasCatchArea a3 = new ZasCatchArea();
a3.setCatchArea("area3");
fisch1.getAreas().add(a1);
fisch1.getAreas().add(a2);
fisch1.getAreas().add(a3);
ZasCatchZone z4 = new ZasCatchZone();
z4.setCatchZone("zone3");
ZasCatchZone z5 = new ZasCatchZone();
z5.setCatchZone("zone2");
ZasCatchZone z6 = new ZasCatchZone();
z6.setCatchZone("zone1");
fisch2.getZones().add(z4);
fisch2.getZones().add(z5);
fisch2.getZones().add(z6);
ZasCatchArea a4 = new ZasCatchArea();
a4.setCatchArea("area3");
ZasCatchArea a5 = new ZasCatchArea();
a5.setCatchArea("area1");
ZasCatchArea a6 = new ZasCatchArea();
a6.setCatchArea("area2");
fisch2.getAreas().add(a4);
fisch2.getAreas().add(a5);
fisch2.getAreas().add(a6);
Diff diff = javers.compare(fisch1, fisch2);
System.out.println(diff);
}
}
I think I founded a solution for my issue. If I register values and value objects like this
final Javers javers = JaversBuilder.javers()
.registerCustomComparator(new ZasCatchAreaComparator(), ZasCatchArea.class)
.registerCustomComparator(new ZasCatchZoneComparator(), ZasCatchZone.class)
.registerValue(ZasCatchArea.class).registerValue(ZasCatchZone.class).registerValueObject(ZasFish.class)
.withListCompareAlgorithm(ListCompareAlgorithm.LEVENSHTEIN_DISTANCE).build();
Then I get as diff
1. ListChange{globalId:'my.javers.comparator.ZasFish/', property:'zones', containerChanges:[(2).'my.javers.comparator.ZasCatchZone#19bef4e5'>>'my.javers.comparator.ZasCatchZone#3f1abed', (1).'my.javers.comparator.ZasCatchZone#e37f307f'>>'my.javers.comparator.ZasCatchZone#2ad1e8a5', (0).'my.javers.comparator.ZasCatchZone#2ccd3209'>>'my.javers.comparator.ZasCatchZone#c0fd1f30']}
2. ListChange{globalId:'my.javers.comparator.ZasFish/', property:'areas', containerChanges:[(2).'my.javers.comparator.ZasCatchArea#48115f4e'>>'my.javers.comparator.ZasCatchArea#a1efa37', (1).'my.javers.comparator.ZasCatchArea#c08d9768'>>'my.javers.comparator.ZasCatchArea#d65a5a2', (0).'my.javers.comparator.ZasCatchArea#bb03583'>>'my.javers.comparator.ZasCatchArea#1ebaaab0']}
And as I don't have any ValueChange in this case I can ignore ListChange -> my Lists are identical.
I have the following class I want to test:
public interface ISqlServiceByModule
{
DataSet GetPagedAggregateData(int clientId, int moduleId, int billTypeId, PagedTable result);
}
public class IncidentModuleService : IIncidentModuleService
{
private readonly ISqlServiceByModule sqlServiceByModule;
public IncidentModuleService(ISqlServiceByModule sqlServiceByModule)
{
if (sqlServiceByModule == null) throw new ArgumentNullException("sqlServiceByModule");
// Inject the ISqlServiceByModule dependency into the constructor
this.sqlServiceByModule = sqlServiceByModule;
}
public PagedTable GetData(int clientId, int moduleId, int billTypeId, Dictionary<string, string> queryStringParameters)
{
PagedTable result = new PagedTable(queryStringParameters);
DataSet dataSet = this.sqlServiceByModule.GetPagedAggregateData(clientId, moduleId, billTypeId, result);
// Map the DatSet to a PagedTable
if (dataSet == null || dataSet.Tables.Count == 0)
{
result.SetPagesFromTotalItems(0);
}
else
{
result.SetPagesFromTotalItems(Convert.ToInt16(dataSet.Tables[1].Rows[0][0]));
result.Listings = dataSet.Tables[0];
}
return result;
}
}
Specifically, I want to test the GetData method. My unit test looks like this:
[TestClass]
public class IncidentModuleServiceUnitTest
{
private DataSet incidentsData;
[TestInitialize]
public void SetUp()
{
this.incidentsData = new DataSet();
}
[TestMethod]
public void GetDataTestGetPagedAggregateDataIsCalled()
{
//-- Arrange
int billTypeId = 1;
int clientId = 1;
int moduleId = 1;
Dictionary<string, string> queryStringParameters = new Dictionary<string,string>();
PagedTable tempResult = new PagedTable(queryStringParameters);
DataSet dataSet = new DataSet();
dataSet.Tables.Add(new DataTable());
var mockSqlService = new Mock<ISqlServiceByModule>();
mockSqlService.Setup(r => r.GetPagedAggregateData(clientId, moduleId, billTypeId, tempResult)).Returns(this.incidentsData);
IncidentModuleService target = new IncidentModuleService(mockSqlService.Object);
//-- Act
var actual = target.GetData(clientId, moduleId, billTypeId, queryStringParameters);
//-- Assert
Assert.IsNull(actual.Listings);
mockSqlService.Verify(r => r.GetPagedAggregateData(clientId, moduleId, billTypeId, tempResult), Times.Once);
}
}
The error I am getting happens on the last line:
mockSqlService.Verify(r => r.GetPagedAggregateData(clientId, moduleId, billTypeId, tempResult), Times.Once);
And the exact error message is this:
{"\r\nExpected invocation on the mock once, but was 0 times: r =>
r.GetPagedAggregateData(.clientId, .moduleId, .billTypeId, .tempResult
Configured setups:\r\nr => r.GetPagedAggregateData(.clientId,
.moduleId, .billTypeId, .tempResult),
Times.Never
Performed invocations:\r\nISqlServiceByModule.GetPagedAggregateData(1,
1, 1, PagedTable)"}
Any idea why this is happening? It looks to me like the method in question is being called, but Moq doesn't like the parameters for some reason, even though they are the exact same ones in all three invocations, as far as I can tell.
PagedTable is a reference type not a value type. Therefore the parameters in Setup don't match what was called even though they look like they should be the same. You could use It.IsAny<PagedTable>() instead of tempResult.
See this answer for an example of how to check that the PagedTable parameter was the correct one.
After lots of research on implementing IntentServices and Alarms together, I've come up with this. I don't know exactly what happens with this code so I need help in knowing exactly what is going on.
public class MainActivity{
//....
public void onNewItemAdded(String[] _entry){
//...
Intent intent = new Intent(MainActivity.this, UpdateService.class);
startService(intent);
}
//....
}
public class AlarmReceiver extends BroadcastReceiver {
#Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
Intent startIntent = new Intent(context, UpdateService.class);
context.startService(startIntent);
}
public static final String ACTION_REFRESH_ALARM = "com.a.b.ACTION_REFRESH_ALARM";
}
public class UpdateService extends IntentService{
//...
#Override
public void onCreate() {
super.onCreate();
alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
String ALARM_ACTION = AlarmReceiver.ACTION_REFRESH_ALARM;
Intent intentToFire = new Intent(ALARM_ACTION);
alarmIntent = PendingIntent.getBroadcast(this, 0, intentToFire, 0);
}
#Override
protected void onHandleIntent(Intent intent) {
Context context = getApplicationContext();
SharedPreferences prefs = PreferenceManager
.getDefaultSharedPreferences(context);
int updateFreq = Integer.parseInt(prefs.getString(
PreferencesActivity.PREF_UPDATE_FREQ, "60"));
boolean autoUpdateChecked = prefs.getBoolean(
PreferencesActivity.PREF_AUTO_UPDATE, false);
if (autoUpdateChecked) {
int alarmType = AlarmManager.ELAPSED_REALTIME_WAKEUP;
long timeToRefresh = SystemClock.elapsedRealtime() + updateFreq
* 60 * 1000;
alarmManager.setInexactRepeating(alarmType, timeToRefresh,
updateFreq * 60 * 1000, alarmIntent);
}
else {
alarmManager.cancel(alarmIntent);
}
refreshKeywords();
}
}
My aim is to get the refreshKeywords() method to be called every minute. Also, what happens if the onNewItemAdded() method is called more than once?
Sorry if this question is stupid, I'm a beginner.
If you wish you to call refreshKeywords()method to be called every minutes why do you use AlarmManager like this,
private void ServiceRunningBackground() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)
{
final int restartAlarmInterval = 6000;
final int resetAlarmTimer = 2*1000;
final Intent restartIntent = new Intent(this, MyService.class);
restartIntent.putExtra("ALARM_RESTART_SERVICE_DIED", true);
final AlarmManager alarmMgr = (AlarmManager)getSystemService(Context.ALARM_SERVICE);
Handler restartServiceHandler = new Handler()
{
#Override
public void handleMessage(Message msg) {
PendingIntent pintent = PendingIntent.getService(getApplicationContext(), 0, restartIntent, 0);
alarmMgr.set(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime() + restartAlarmInterval, pintent);
sendEmptyMessageDelayed(0, resetAlarmTimer);
}
};
restartServiceHandler.sendEmptyMessageDelayed(0, 0);
}
}
Just call this method where ever you want and set the time accordingly
////OSMdroid centered on the markers////
I add markers, I need to map the maximum increases or decreases in such a way that all markers were visible
my code:
public class mapcode extends Activity {
globalvar appState;
int stats=0;
private MapView mapView;
private IMapController mapController;
private SimpleLocationOverlay mMyLocationOverlay;
private ScaleBarOverlay mScaleBarOverlay;
ItemizedIconOverlay<OverlayItem> currentLocationOverlay;
DefaultResourceProxyImpl resourceProxy;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setContentView(R.layout.map);
appState = ((globalvar) getApplicationContext());
mapView = (MapView) this.findViewById(R.id.mapview);
mapView.setTileSource(TileSourceFactory.MAPNIK);
// mapView.setBuiltInZoomControls(true); //кнопка ZOOM +-
mapView.setMultiTouchControls(true);
mapController = this.mapView.getController();
mapController.setZoom(2);
this.mMyLocationOverlay = new SimpleLocationOverlay(this);
this.mapView.getOverlays().add(mMyLocationOverlay);
this.mScaleBarOverlay = new ScaleBarOverlay(this);
this.mapView.getOverlays().add(mScaleBarOverlay);
// this.mapView
/////////////////
resourceProxy = new DefaultResourceProxyImpl(getApplicationContext());
GeoPoint currentLocation = new GeoPoint(55.860863,37.115046);
GeoPoint currentLocation2 = new GeoPoint(63.557413,-156.102119);
OverlayItem myLocationOverlayItem = new OverlayItem("Here", "Current Position", currentLocation);
Drawable myCurrentLocationMarker = this.getResources().getDrawable(R.drawable.a);
myLocationOverlayItem.setMarker(myCurrentLocationMarker);
// myLocationOverlayItem.setMarkerHotspot(HotspotPlace.CENTER); //no working/
final ArrayList<OverlayItem> items = new ArrayList<OverlayItem>();
items.add(myLocationOverlayItem);
myLocationOverlayItem = new OverlayItem("Here", "Current Position", currentLocation2);
myCurrentLocationMarker = this.getResources().getDrawable(R.drawable.a);
myLocationOverlayItem.setMarker(myCurrentLocationMarker);
// myLocationOverlayItem.setMarkerHotspot(HotspotPlace.CENTER); // no working
items.add(myLocationOverlayItem);
currentLocationOverlay = new ItemizedIconOverlay<OverlayItem>(items,
new ItemizedIconOverlay.OnItemGestureListener<OverlayItem>() {
public boolean onItemSingleTapUp(final int index, final OverlayItem item) {
return true;
}
public boolean onItemLongPress(final int index, final OverlayItem item) {
return true;
}
}, resourceProxy);
this.mapView.getOverlays().add(this.currentLocationOverlay);
}
I added two markers, but only one is visible:
and I need to osmdroid is centered and immediately showed both marker
I think you want something like this:
int minLat = Integer.MAX_VALUE;
int maxLat = Integer.MIN_VALUE;
int minLong = Integer.MAX_VALUE;
int maxLong = Integer.MIN_VALUE;
ArrayList<OverlayItem> items = new ArrayList<OverlayItem>();
for (OverlayItem item : items) {
GeoPoint point = item.getPoint();
if (point.getLatitudeE6() < minLat)
minLat = point.getLatitudeE6();
if (point.getLatitudeE6() > maxLat)
maxLat = point.getLatitudeE6();
if (point.getLongitudeE6() < minLong)
minLong = point.getLongitudeE6();
if (point.getLongitudeE6() > maxLong)
maxLong = point.getLongitudeE6();
}
BoundingBoxE6 boundingBox = new BoundingBoxE6(maxLat, maxLong, minLat, minLong);
mMapView.zoomToBoundingBox(boundingBox);
You can calculate boundingBox by BoundingBox.fromGeoPoints(geoPoints)
fun zoomToBounds(points: List<LatLng>) {
val geoPoints = points.map { GeoPoint(it.latitude, it.longitude) }
val boundingBox = BoundingBox.fromGeoPoints(geoPoints)
mapView.zoomToBoundingBox(boundingBox, true)
}
It is also possible to have some paddings by using zoomtoBoundingBox overloaded method and setting the pBorderSizeInPixels parameter
public double zoomToBoundingBox(
final BoundingBox pBoundingBox,
final boolean pAnimated,
final int pBorderSizeInPixels,
final double pMaximumZoom,
final Long pAnimationSpeed
)
I haven't used java since version 4 and casting seams to have changed to the point where it's almost annoying. I don't understand how to approach the following compile error.
HelloWorld.java:70: error: no suitable method found for
add(Series)
lineChart.getData().add(series);
^
method List.add(int,Series) is not applicable
(actual and formal argument lists differ in length)
method List.add(Series) is not applicable
(actual argument Series cannot be converted to Series by method invocation conversion)
Here is my code:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.chart.LineChart;
import javafx.scene.chart.NumberAxis;
import javafx.scene.chart.XYChart;
import javafx.scene.chart.*;
import javafx.stage.Stage;
import javafx.geometry.Side;
import java.lang.*;
import java.net.*;
import java.io.*;
import java.util.*;
public class HelloWorld extends Application {
#Override public void start(Stage stage) {
Vector <String[]> v = new Vector<String[]>();
try{
File f = new File("audjpy.txt");
BufferedReader br = new BufferedReader(new FileReader(f));
String line;
String[] data;
int count = 0;
while ((line = br.readLine()) != null) {
data = line.split(",");
if(count>0)v.add(data);
if(count == 400)break;
count++;
}
br.close();
}catch(IOException e){System.out.println(e);}
stage.setTitle("Line Chart Sample");
//defining the axes
NumberAxis xAxis = new NumberAxis();
NumberAxis yAxis = new NumberAxis();
yAxis.setSide(Side.RIGHT);
xAxis.setLabel("Number of Month");
//creating the chart
final LineChart<Number,Number> lineChart =
new LineChart<Number,Number>(xAxis,yAxis);
lineChart.setTitle("Stock Monitoring, 2010");
//defining a series
XYChart.Series<Double, Double> series = new XYChart.Series<Double, Double>();
series.setName("My portfolio");
//populating the series with data
//<TICKER>,<DTYYYYMMDD>,<TIME>,<OPEN>,<HIGH>,<LOW>,<CLOSE>,<VOL>
Enumeration<String[]> e = v.elements();
while(e.hasMoreElements()){
String[] data = e.nextElement();
double x = Double.parseDouble(data[4]);
double y = Double.parseDouble(data[5]);
series.getData().add(new XYChart.Data<Double, Double>(x,y));
}
Scene scene = new Scene(lineChart,800,600);
lineChart.getData().add(1, series);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
The reasons seems like it is because you are using Double and Number interchangeable, change every generic to Number and your problem should be solved.
#Override
public void start(Stage stage) {
Vector<String[]> v = new Vector<String[]>();
try {
File f = new File("audjpy.txt");
BufferedReader br = new BufferedReader(new FileReader(f));
String line;
String[] data;
int count = 0;
while ((line = br.readLine()) != null) {
data = line.split(",");
if (count > 0) {
v.add(data);
}
if (count == 400) {
break;
}
count++;
}
br.close();
} catch (IOException e) {
System.out.println(e);
}
stage.setTitle("Line Chart Sample");
//defining the axes
NumberAxis xAxis = new NumberAxis();
NumberAxis yAxis = new NumberAxis();
yAxis.setSide(Side.RIGHT);
xAxis.setLabel("Number of Month");
//creating the chart
final LineChart<Number, Number> lineChart = new LineChart<Number, Number>(xAxis, yAxis);
lineChart.setTitle("Stock Monitoring, 2010");
//defining a series
XYChart.Series<Number, Number> series = new XYChart.Series<Number, Number>();
series.setName("My portfolio");
//populating the series with data
//<TICKER>,<DTYYYYMMDD>,<TIME>,<OPEN>,<HIGH>,<LOW>,<CLOSE>,<VOL>
Enumeration<String[]> e = v.elements();
while (e.hasMoreElements()) {
String[] data = e.nextElement();
double x = Double.parseDouble(data[4]);
double y = Double.parseDouble(data[5]);
series.getData().add(new XYChart.Data<Number, Number>(x,y));
}
Scene scene = new Scene(lineChart, 800, 600);
lineChart.getData().add(1, series);
stage.setScene(scene);
stage.show();
}