Skip to content

Commit

Permalink
JFXEX-00366: ChartFX: Added ScatterChart 3D Value Generator #408
Browse files Browse the repository at this point in the history
  • Loading branch information
ndp1410 committed Jun 21, 2019
1 parent 273c4e5 commit 62f8d1e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import de.dc.javafx.xcore.workbench.chart.ChartProject;
import de.dc.javafx.xcore.workbench.chart.SeriesFX;
import de.dc.javafx.xcore.workbench.chart.XYValueFX;
import de.dc.javafx.xcore.workbench.chart.XYZSeriesFX;
import de.dc.javafx.xcore.workbench.chart.XYZValueFX;
import de.dc.javafx.xcore.workbench.chart.ui.view.ChartFXPreview;
import de.dc.javafx.xcore.workbench.di.DIPlatform;
import de.dc.javafx.xcore.workbench.emf.ui.EmfDetailedTreeView;
Expand Down Expand Up @@ -56,6 +58,16 @@ private void generateDummyValues() {
value.setValue(random.nextDouble());
values.add(value);
}
}else if (selection.getValue() instanceof XYZSeriesFX) {
series = (XYZSeriesFX) selection.getValue();
for (int i = 0; i < 50; i++) {
XYZValueFX value = ChartFactory.eINSTANCE.createXYZValueFX();
value.setX(i+5);
value.setY(random.nextDouble());
value.setZ(random.nextDouble());
values.add(value);
}

}

if (series!=null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public class ChartFXRenderer extends ChartSwitch<Node> {
public Node caseScatterChart3dFX(ScatterChart3dFX object) {
XYZSeriesCollection<String> dataset = new XYZSeriesCollection<>();
for (XYZSeriesFX seriesFX : object.getSeries()) {
String name = seriesFX.getName();
String name = seriesFX.getName()==null? "Test "+object.getSeries().indexOf(seriesFX) : seriesFX.getName();
XYZSeries<String> series = new XYZSeries<>(name);
for (XYZValueFX valueFX : seriesFX.getValues()) {
series.add(valueFX.getX(), valueFX.getY(), valueFX.getZ());
Expand Down

0 comments on commit 62f8d1e

Please sign in to comment.