0

My project structure is as:

enter image description here

I am trying to load a Gantt chart without flash player, but it is not displaying any chart on screen.

and below is code

String chartId = "myChartId" + Math.random();
    String html = "<html>"
      + "  <head>"
      + "   <title>Multi Series Step Line Chart</title>"
      + "   <script type='text/javascript' language='JavaScript' src='file:///android_asset/Chart/FusionCharts.js'></script>"
      + "   <script type='text/javascript' language='JavaScript' src='file:///android_asset/Chart/FusionCharts.HC.Widgets.js'></script>"
      + "   <script type='text/javascript' language='JavaScript' src='file:///android_asset/Chart/jquery.min.js'></script>"
      + "   <script type='text/javascript' language='JavaScript' src='file:///android_asset/Chart/FusionCharts.HC.js'></script>"
      + "   <script type='text/javascript' language='JavaScript' src='file:///android_asset/Chart/FusionCharts.HC.gantt.js'></script>"
      + "   <script type='text/javascript' language='JavaScript' src='file:///android_asset/Chart/FusionCharts.jqueryplugin.js'></script>"
      + "  </head>"
      + "  <body>"
      + "   <div id='chartdiv' align='center'>Graph will load here"
      + "  <script type='text/javascript' >"
      + "  FusionCharts.setCurrentRenderer('javascript') "
      + "       var chart = new FusionCharts('file:///android_asset/Chart/Gantt.swf', '"
      + chartId + "', '1230', '300', '0','1');"
      + "       chart.setXMLUrl('" + getFilesDir()
      + File.separator + "Data.xml" + "');"
      + "       chart.render('chartdiv'); " + "</script>"
      + "   </div>" + "  </body>" + " </html>";
    System.out.println("Html a is " + html);
    WebView web_view = (WebView) findViewById(R.id.driver_log);
    WebSettings webSettings = web_view.getSettings();
    webSettings.setPluginState(PluginState.ON);
    webSettings.setJavaScriptEnabled(true);
    webSettings.setLoadWithOverviewMode(true);
    web_view.loadDataWithBaseURL("file:///android_asset/", html,
      "text/html", "UTF-8", null);
Teekam
  • 939
  • 4
  • 14
  • 26

2 Answers2

0

Please make sure you are using FusionWidgets XT (v3.3.1) and above for rendering JavaScript variant of the Gantt chart.

Also, ensure FusionCharts.HC.js, FusionCharts.HC.Widgets.js, FusionCharts.HC.Gantt.js and jquery.min.js are kept in the same folder as FusionCharts.js.

  • Sanjukta, I am implementing it for android tablet but is is not responding. Can you please give me some example? – Teekam Dec 27 '13 at 10:14
0

You can refer the attached sample of using FusionWidgets in an Android native application.

Similarly, you can update this application to render a Gantt chart instead of Angular Gauge.

Also, the PDF may prove to be helpful.

FusionWidget+Android Sample - https://www.dropbox.com/s/tisri8pefjmpei2/FusionWidgets.zip

PDF- How to use FusionCharts with Android Mobile Applications- https://www.dropbox.com/s/pz9772tvobxooel/Android%20Native_How%20to%20use.pdf

FraZer
  • 1,685
  • 1
  • 10
  • 17
  • 1
    Thanks a lot dear FraZer! You have done s great job, thank u so much. – Teekam Dec 27 '13 at 12:39
  • Its ok Teekam... :) Good to know that it helped...write 2 me in case other Queries regarding the Android implementation :) – FraZer Dec 27 '13 at 13:37
  • Dear FraZer, Thanks for your support. Currently i am facing a problem regarding to app is on foreground or background. submitted a question on below link , please have look http://stackoverflow.com/questions/20822492/app-crashes-on-bringing-it-to-foreground-in-android – Teekam Dec 29 '13 at 05:37
  • Dear FraZer please suggest for below question http://stackoverflow.com/questions/21845153/why-app-service-restarting-and-not-able-to-restart – Teekam Feb 18 '14 at 08:41
  • Dear Teekam, It's not clear how you implemented, the problem should not occur normally. Please let me know some more info that may be helpful. Also you may explicitly perform grbge collection before the starting of the service, this may help. – FraZer Feb 27 '14 at 16:39