Echart. JS Plugin rendering error data.length<1?

Source: Internet
Author: User

Problem

Getjson Submit return data is normal, in the incoming parameters are serialized, render the report times wrong Option.data.length < 1.

Analysis

1. Possible situation one:

.

But it is Getjson () to put the rendering in the success callback function, so obviously not this error

2. Possible scenario Two:

The serialized data is not fetched to NULL, so hint option.data.length<1

Reason:

When serializing the horizontal axis data, the horizontal axis is initialized by a switch (type) based on the different types, but the type 0 passed in is a string type and the type in switch (type) is numeric so it does not match the initialization data bit null

types=type;            types=parsesint (type); Switch(types) { Case0:// Dayvar strdate= Date.getmonth () + 1 + "/" +date.getdate ();                    Xaxis.push (strdate);  Break;  Case1://Weekvar strdate = date.getmonth () + 1 + "/" +date.getdate ();                    Xaxis.push (strdate);  Break;  Case5 |//Customvar strdate = date.getmonth () + 1 + "/" +date.getdate ();                    Xaxis.push (strdate);  Break; default :                     Break; }

Your mother pit me an afternoon, the procedure is the procedure, cannot go through must have the problem, so still want to calm down to analyze the reason, one step at a pace

parseint (type) converted to numeric type

Echart. JS Plugin rendering error data.length<1?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.