Dear List members,

I am implementing the FusionChart Library into my project (just the example code), but am struggling. I should mention that I am using tapestry-jquery (replaces prototype with jQuery).

I have a javascript file (embed_fusionchart.js) containing one function bmiChart() that runs the necessary code. In my component FusionChartComponent.java I import the Javascript library (FusionChart.js) and my embed_fusionchart.js file. In beginRender(MarkupWriter writer) I put out the necessary div tag and then add a call to the JavaScript funtion to output the chart with javaScriptSupport.addInitializerCall. But that does not work. If I ouptut the call to bmiChart() with writer, it works just fine.

Does JavaScriptSupport only work with Prototype? Any hint is appreciated.

Regards
Daniel

WORKS:
void beginRender(MarkupWriter writer){
        writer.element("script", "language", "javascript");
        writer.write("bmiChart();");
        writer.end();
}

DOES NOT WORK:
        @Environmental
        private JavaScriptSupport jsSupport;

void beginRender(MarkupWriter writer){
        jsSupport.addInitializerCall("bmiChart();", new JSONObject());
}

--------------------------------------------

that's the content on embed_fusionchart.js:

function bmiChart(){
    var myChart = new FusionCharts( "/assets/fusioncharts/Column3D.swf",
          "myChartId", "400", "300", "0", "1" );
        myChart.setJSONData({
                "chart": {
                    "caption" : "Weekly Sales Summary" ,
                    "xAxisName" : "Week",
                    "yAxisName" : "Sales",
                    "numberPrefix" : "$"
            },

            "data" :
                    [
                      { "label" : "Week 1", "value" : "14400" },
                      { "label" : "Week 2", "value" : "19600" },
                      { "label" : "Week 3", "value" : "24000" },
                      { "label" : "Week 4", "value" : "15700" }
                    ]
    });
      myChart.render("chartContainer");
}

--
Mit freundlichen Grüßen
Daniel Henze

+49.177.7427002

Geraer Str. 22
15366 Neuenhagen


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to