This is a migrated thread and some comments may be shown as answers.

Line chart - can show missing value as zero?

2 Answers 95 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Pon
Top achievements
Rank 1
Pon asked on 19 Jun 2015, 11:20 AM

Hi,

 

I m drawing line chart using line chart, consider i have a data for the days 1,2,4 and 7 in the x-axis and 0 -100 in y axis . The line chart draws perfectly on the nodes 1 to 2, 2 to 4 and 4 to 7. But the the problem is here in x- axis 3, 5 and 6 is missing (obviously the node not drawn there) . is that any way to show the line chart 1 to 2, 2 to 3 ( go default to zero even no value is mention to draw), 3 to 4, 4 to 5, 5 to 6, 6 to 7.  Exactly to say the missing values which is not given from the user it should go down to zero and draw the nodes which the actual data. please see the screen shot for further reference.

 

When no value it should not directly pass to next node, My idea to show the amount of sales in particular day/month, the missing days/month not having any data means no sales. should go down to zero. If I process from back-end its huge amount of data generate for zeros. Please help me out from this problem with possible solutions. 

 

Thanks,

Jagan

2 Answers, 1 is accepted

Sort by
0
Accepted
EZ
Top achievements
Rank 2
answered on 19 Jun 2015, 01:41 PM

Have you tried setting the series missingValues property to "zero"?

Missing Values Docs

Here is a DEMO

 

series: [{
   type: "line",
   field: "Count",
   categoryField: "Date",
   missingValues : "zero",
}],

 

0
Pon
Top achievements
Rank 1
answered on 19 Jun 2015, 01:52 PM

Wow amazing, This what I looking for.

thank you very much.

You saved my day. It is working Fine :)

 

Regards,

Jagan

 

 

Tags
Charts
Asked by
Pon
Top achievements
Rank 1
Answers by
EZ
Top achievements
Rank 2
Pon
Top achievements
Rank 1
Share this question
or