Sree24

.Net View "FusionChartDataFormats" undefined

Recommended Posts

My application uses VS 2015 MVC 5, I am trying to incorporate charts in my project with the following simple Jquery based Fusion charts.

I was getting the error "0x800a1391 - JavaScript runtime error: 'FusionChartsDataFormats' is undefined"

references in script in layout page :

<script type="text/javascript" src="/Scripts/jquery-1.10.2.min.js"></script>
    <script type="text/javascript" src="/fusioncharts/js/fusioncharts.js"></script>
    <script type="text/javascript" src="/fusioncharts/js/fusioncharts.charts.js"></script>
    <script type="text/javascript" src="/fusioncharts/js/fusioncharts-jquery-plugin.min.js"></script>
    <script type="text/javascript" src="/fusioncharts/js/fusioncharts-jquery-plugin.js"></script>
    <script type="text/javascript" src="/fusioncharts/js/themes/fusioncharts.theme.fint.js"></script>
    <script type="text/javascript" src="/fusioncharts/js/FusionCharts.jqueryplugin.js"></script> 

 

here is the script in my view to call the Jquery FC function:

 

<script type="text/javascript">
        $(document).ready(function () {
            alert("I am here");
            //jQuery.ajax({
            //    type: 'GET',
            //    url: '/vs3/dashboard/getSinistralidadePSChart',
            //success: function (data, textStatus) {
            //    jQuery('#sinistralidadePSScript').html(
            //        'var chart = new FusionCharts("Area2D", "sinistralidadePSSpan", "650", "300", "0", "0","");' +
            //    "chart.setXMLData('" + data + "');" +
            //    'chart.render("sinistralidadePlanoSaude");'
            //    );
            //},
            //error: function (XMLHttpRequest, textStatus, errorThrown) {},
            //complete: function (XMLHttpRequest, textStatus) {
            //    true
            //}
            //});

            $("#chart-container").insertFusionCharts({
                type: "fusioncharts/column2d.swf",
                width: "500",
                height: "300",            
                dataSource: {
                    "chart": {
                        "caption": "Monthly revenue",
                        "subCaption": "Last Year",
                        "xAxisName": "Month",
                        "yAxisName": "Revenues",
                        //Making the chart export enabled in various formats
                        "exportEnabled": "1",
                        "numberPrefix": "$",
                        "theme": "fint"
                    },

                    "data": [{"label": "Jan",
                        "value": "420000"
                    }, {
                        "label": "Feb",
                        "value": "810000"
                    }, {
                        "label": "Mar",
                        "value": "720000"
                    }, {
                        "label": "Apr",
                        "value": "550000"
                    }, {
                        "label": "May",
                        "value": "910000"
                    }, {
                        "label": "Jun",
                        "value": "510000"
                    }, {
                        "label": "Jul",
                        "value": "680000"
                    }, {
                        "label": "Aug",
                        "value": "620000"
                    }]
                },
                dataFormat: "JSON",
            });
           
            alert("I am out");
        });
    </script>

 

Can you let me know the issue with this Jquery call in view, ASAP.

--

Thanks

Share this post


Link to post
Share on other sites

HI,

 

From your code i can see that there is no issue with your data format , but you are using older version of FusionCharts which uses flash to render chart . We have deprecated the support for Flash. Hence, we do not support *.swf component. 

 

Try upgrading to latest version and check once.

 

Thanks

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