We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

jquery-3.1.1.min.js:2 Uncaught TypeError: Cannot read property 'intervalType' of undefined

Hi,

during the Load I receive the error.
Here is my definition for the chart:
    @(Html.EJ().Chart("queryRes")
                .PrimaryXAxis(xaxis => xaxis.Title(tit => tit.Text("Mikor"))
                    .ValueType(AxisValueType.Datetime)
                    .LabelFormat("MM/dd/yyyy")
                    .LabelIntersectAction(LabelIntersectAction.Rotate45)
                    )
                .PrimaryYAxis(yaxis => yaxis.Title(tit => tit.Text("Válaszidő"))
                    .LabelFormat("{value}sec")
                )
                .Crosshair(cr => cr.Visible(true).Type(CrosshairType.Trackball))
                .CanResize(true)
                .CommonSeriesOptions(cr => cr.EnableAnimation(true).Type(SeriesType.Line))
                .IsResponsive(true)
                .Size(sz => sz.Height("600"))
                .Legend(lg => lg.Visible(false))
                .Zooming(zn => zn.Enable(true).Type("X").EnableMouseWheel(true).EnableScrollbar(true))
                .Locale("hu-HU")
                .Load("onchartload")
                .EnableCanvasRendering(true)
        )
And the JS for Load methode:
   function onchartload(sender) {
        var queryID = -1;
        var dtFrom = $('#dateFrom').val();
        var dtTo = $('#dateTo').val();
        var durl = '@Url.Action("GetData", "OracleCheck")';
        $.ajax({
            type: "POST",
            url: durl,
            data: { "queryID": queryID, "dtFrom": dtFrom, "dtTo": dtTo },
            async: false,
            success: function (jdata) {
                sender.model.series[0].dataSource = jdata;
                sender.model.series[0].xName = "dWhen";
                sender.model.series[0].yName = "respTime";
            },
            error: function (jqXHR, textStatus, errorThrown) {
                alert('Exeption:' + errorThrown);
            }
        });
    }
If I remove the valuetype and label format, then loads the chart with some random data.
If I remove the valutype and  keep the label format:  Uncaught Bad number format specifier: M (changing the label format to yyyy-MM-dd gives error for 'Y').
And here is the code for Controller:
    public ActionResult GetData(string queryID, DateTime dtFrom, DateTime dtTo)
        {
            List<RESPONSECHECKERRES> retl = new List<RESPONSECHECKERRES>();
            int qry = -1;
            int.TryParse(queryID, out qry);

            _dbc.Configuration.ProxyCreationEnabled = false;
            retl = _dbc.RESPONSECHECKERRES.Where(w => w.RCRESWHEN >= dtFrom && w.RCRESWHEN < dtTo).OrderBy(o => o.RCRESWHEN).ToList();
            if (qry > 0)
                retl = retl.Where(w => w.RC_RES_ID == qry).ToList();
            List<OraChartData> cd = new List<OraChartData>();
            foreach (var li in retl)
                cd.Add(new OraChartData()
                {
                    dWhen       = li.RCRESWHEN,
                    respTime    = (double) li.RCRESTIME,
                });
            return Json(cd);
        }
Thanks in advance!
József

3 Replies

DD Dharanidharan Dharmasivam Syncfusion Team August 14, 2017 12:54 PM UTC

Hi Jozsef, 
 
Thanks for contacting Syncfusion support. 
 
We have anayzed yoru query. Find the response for your queries below. 
 
Query 
Response 
If I remove the valuetype and label format, then loads the chart with some random data. 
We have tried to replicate the reported scenario with your code example. But unfortunately the reported issue is not reproduced at our end. If you remove the value type and label format and if the data source (x value) is in string format, then chart will render in category axis. We have prepared as sample in which in the ajax request we have bind date time values for x axis. Sample used for testing can be find from below link. 
 
 
Screenshot: 
 
 
 
If I remove the valutype and  keep the label format:  Uncaught Bad number format specifier: M 
If the data soruce (x value) is in date time format, then if you remove the value type and specify the label format for date time, the error might be occur. But with our data source the error is not reporduced. Sample used for testing can be find from below link. 
 
 
 
 
 
Since we are not aware of your exact scenario on which the issue is reproduced, we would like to know the following detials, which will helpful in further analysis and provide you the solution sooner. 
 
  • Try to replicate the reported issue with the attached sample
  • Or provide your sample with replication steps.
  • Provide your data source.
  • Current version of Essential Studio you are using.
 
Thanks, 
Dharani. 




JA Jozsef Antal August 14, 2017 01:44 PM UTC

Hi Dharani,


thanks for the sample - my problems was solved!

What I had to change is include 'sender.model.series[0] = {};' in the onload function!

Now the formatting, etc. works correctly.

Thanks again for your valuable help!

József




DD Dharanidharan Dharmasivam Syncfusion Team August 15, 2017 03:46 AM UTC

Hi Jozsef, 

Thanks for the update. 

Kindly revert us, if you need further assistance. 

Dharani. 



Loader.
Up arrow icon