Skip to content

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

@GoogleCodeExporter

Description

@GoogleCodeExporter

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 Alef...@gmail.com on 6 Sep 2010 at 9:35

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions