Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

impossible to draw javafx.scene.chart.PieChart into a Widget obj #65

Open
GoogleCodeExporter opened this issue Mar 22, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link


I see the applet working as expected but the docked one (into the widgetFx) 
showiong just the text ("Pie Chart").

What version of the product are you using? On what operating system?
javafx 1.2 and widgetfx 1.2

here the code 

import javafx.stage.Alert;
import javafx.scene.Scene;
import javafx.scene.chart.PieChart;
import javafx.scene.chart.PieChart3D;
import org.dataengine.widgets.DataAccess.LoadXMLData;
import org.dataengine.widgets.DataModel.StandardDataObject;
import javafx.scene.Group;
import org.widgetfx.Widget;
import org.widgetfx.config.Configuration;
import javafx.scene.control.Skin; 
import javafx.stage.Stage;
import javafx.scene.*;



/**
 * @author AlessioFimognari & harrythompson
 */

var standarddataobjects:StandardDataObject[];

var loadxmldata = LoadXMLData {
    onDone: function( data:StandardDataObject[] ) {
        standarddataobjects = data;
        makeseries();
    }
};

loadxmldata.loadData();

var series:PieChart.Data[];
function makeseries() {
    println("Making dataseries...");
    for (standarddataobject in standarddataobjects) {
        var value:Number = java.lang.Double.valueOf(standarddataobject.series);
        var datapoint = PieChart.Data { label: {standarddataobject.label} value: {value} action:function(){Alert.inform("{standarddataobject.label} {value}")}}
        insert datapoint into series;
    }
    println("Loading chart...");
    makechart();
}

function makechart() {
    Stage {
        scene   : Scene {
            height  : 320
            width   : 320
            content : PieChart {
                title           : "Pie Chart"
                //pieThickness  : 20
                startAngle      : 0
                scaleX          : 0.7
                scaleY          : 0.7
                translateX      : -95
                data            : series
            }
        }
    }
}



  var widget = Widget {
      width: 320;
      height: 240;
      aspectRatio: 320 / 240;
      content: PieChart {
                                            title           : "Pie Chart"
                                            //pieThickness  : 20
                                            startAngle      : 0
                                            scaleX          : 0.7
                                            scaleY          : 0.7
                                            translateX      : -95
                                            visible         : true
                                            data            : series
                                        };
  }



  return widget;

Original issue reported on code.google.com by [email protected] on 6 Sep 2010 at 9:35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant