Sign in to follow this  
gifang

chart type not support error

Recommended Posts

Hi, all
 
I am new to this plugin. I have got a problem about using this plugin in my website (codeigniter php framework). I used the codes from the tutorial (
http://docs.fusioncharts.com/tutorial-getting-started-your-first-charts-building-your-first-chart.html) about how to use it. However, my chart still can not be shown successfully. 
 
I inserted the below code in my website.
<script type="text/javascript" src="<?php echo asset_url(); ?>/js/fusioncharts.js"></script>
<script type="text/javascript" src="<?php echo asset_url(); ?>/js/fusioncharts.theme.fint.js"></script>
<script type="text/javascript">
  FusionCharts.ready(function(){
    var revenueChart = new FusionCharts({
        "type": "line",
        "renderAt": "chartContainer",
        "width": "305",
        "height": "240",
        "dataFormat": "json",
        "dataSource":  {
          "chart": {
            "caption": "House price growth - 10 - year - period",
            "subCaption": " ",
            "xAxisName": "QUARTER ENDED JUNE",
            "yAxisName": "MEDIAN PRICE ($)",
            "theme": "fint"
         },
         "data": [
            {
               "label": "2006",
               "value": "380000"
            },
            {
               "label": "2007",
               "value": "410000"
            },
            {
               "label": "2008",
               "value": "430000"
            },
            {
               "label": "2009",
               "value": "400000"
            },
            {
               "label": "2010",
               "value": "550000"
            },
            {
               "label": "2011",
               "value": "560000"
            },
            {
               "label": "2012",
               "value": "510000"
            },
            {
               "label": "2013",
               "value": "530000"
            },
            {
               "label": "2014",
               "value": "630000"
            },
            {
               "label": "2015",
               "value": "650000"
            },
          ]
      }
 
  });
revenueChart.render();
})
</script>
 
then I added 
<div id="chartContainer">FusionCharts XT will load here!</div>
 
then I copied the fusioncharts.js and fusioncharts.theme.fint.js in \assets\js folder which is the correct direction.
 
Everything should be fine at this stage. However, when I refresh my website. I got this error (see the attachment).

I also added debugger code in this website. It seems that there is something wrong with JavaScript code. But I can not figure out why and how to solve it.

My browser reported that Uncaught SyntaxError: Unexpected token < in fusioncharts.charts.js:2.

 

Can anyone helps me? 

Thanks a lot

Gifang

 

 

post-63775-0-14687700-1418698034_thumb.jpg

post-63775-0-00324900-1418698250_thumb.jpg

Share this post


Link to post
Share on other sites

Hi,

 

Can you please specify some more details regarding your implementation?

1. Are you implementing it via Model View Controller functions? If yes, then please specify the path.

2. In which browser you are trying to render the chart?

 

Awaiting response.

Share this post


Link to post
Share on other sites

Hi,

 

Can you please specify some more details regarding your implementation?

1. Are you implementing it via Model View Controller functions? If yes, then please specify the path.

2. In which browser you are trying to render the chart?

 

Awaiting response.

Hi, Vishalika

 

Thanks for your reply.

1. Yes, I used MVC framework which is PHP Codeigniter Framework. I copied HTML  and JSON code in view folder. I also copied fusioncharts.js and fusioncharts.theme.fint.js in assets/js folder. <script type="text/javascript" src="<?php echo asset_url(); ?>/js/fusioncharts.theme.fint.js"></script> However, it still didn't work

2. I tried google chrome and Firefox browser. none of them are working so far.

 

Could you please help me? 

Thanks a lot

Share this post


Link to post
Share on other sites

Hi,

 

Glad to know that your issue is resolved.  :)

 

Happy FusionCharting!!!

Thanks. But I have found another problems.

When I try to load this diagram(exact same codes) in another website, the diagram can not be shown correctly.

Do you know why it happens and how to solve it?

 

Thanks Neal

post-63775-0-27057300-1418877982_thumb.jpg

Share this post


Link to post
Share on other sites

Hi.

 

We are unable to replicate this from our end.

 

Could you please share the scaled down sample or  the XML/JSON data of the chart?

 

Awaiting response.

JS Code:
<script type="text/javascript">
  FusionCharts.ready(function(){
    var revenueChart = new FusionCharts({
        "type": "line",
        "renderAt": "syd",
        "width": "305",
        "height": "240",
        "dataFormat": "json",
        "dataSource":  {
          "chart": {
            "caption": "House price growth - 10 - year - period",
            "subCaption": " ",
            "xAxisName": "QUARTER ENDED JUNE",
            "yAxisName": "MEDIAN PRICE ($)",
            "theme": "fint"
         },
         "data": [
            {
               "label": "2006",
               "value": "510000"
            },
            {
               "label": "2007",
               "value": "530000"
            },
            {
               "label": "2008",
               "value": "550000"
            },
            {
               "label": "2009",
               "value": "560000"
            },
            {
               "label": "2010",
               "value": "610000"
            },
            {
               "label": "2011",
               "value": "620000"
            },
            {
               "label": "2012",
               "value": "610000"
            },
            {
               "label": "2013",
               "value": "670000"
            },
            {
               "label": "2014",
               "value": "800000"
            },
            {
               "label": "2015",
               "value": "860000"
            },
          ]
      }
 
  });
revenueChart.render();
})
</script>
 
HTML code:
<div id="syd">FusionCharts XT will load here!</div>
 
I can not find any error in my code. Could you please check it for me? 
Thanks

Share this post


Link to post
Share on other sites

Hi,

 

As  per your code, we are unable to replicate the issue from our end. It is working fine.

 

Could you please specify you MVC details of CodeIgniter for rendering this code and the website details in which you are rendering this chart?

 

Awaiting response.

Edited by Vishalika

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this