The type inferencing might have a problem if you use arrayToDataTable and
the first rows contain nulls.  Not sure about that.  Try setting up your
DataTable by explicitly typing the columns instead, by calling addColumn()
for each column followed by addRows().  Hope that helps.



On Tue, Aug 9, 2016 at 10:28 AM, virendra chaudhary <
[email protected]> wrote:

> Yes. I have tried null and blank but It is giving me error "All series on
> a given axis must be of the same data type"
>
> On Tuesday, 9 August 2016 19:34:25 UTC+5:30, Daniel LaLiberte wrote:
>>
>> Have you tried using a null value instead of 0?
>>
>> On Tue, Aug 9, 2016 at 5:12 AM, virendra chaudhary <
>> [email protected]> wrote:
>>
>>> I want to create Stacked Column Chart which should not display anything
>>> related to a entity whose count is zero.
>>>
>>> I am using below html code. It is displaying a red line on top of green
>>> bar even if count is zero for the entity related to red(Failed). I want to
>>> remove this line.
>>>
>>> Please help me.
>>>
>>> <html>
>>>   <head>
>>>       <script type="text/javascript" src="https://www.gstatic.com/c
>>> harts/loader.js"></script>
>>>    <script type="text/javascript">
>>>       google.charts.load('current', {packages: ['corechart', 'bar']});
>>> google.charts.setOnLoadCallback(drawStacked);
>>>
>>> function drawStacked() {
>>>      var data = google.visualization.arrayToDataTable([
>>>         ['Genre','Passed', 'Failed',  { role: 'annotation' } ],
>>>         ['DashBoard', 10, 0, ''],
>>>
>>>       ]);
>>>
>>>       var options = {
>>>         width: 600,
>>>         height: 400,
>>>         legend: { position: 'top', maxLines: 3 },
>>>         bar: { groupWidth: '75%' },
>>> colors:["green","red","black"],
>>>         isStacked: true
>>>       };
>>>
>>>       var chart = new google.visualization.ColumnCha
>>> rt(document.getElementById('chart_div'));
>>>       chart.draw(data, options);
>>>     }
>>>     </script>
>>>   </head>
>>>   <body>
>>>     <div id="chart_div"></div>
>>>   </body>
>>> </html>
>>>
>>>
>>>
>>> Many Thanks!
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Google Visualization API" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at https://groups.google.com/grou
>>> p/google-visualization-api.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/google-visualization-api/098b753c-adbd-4caf-a30f-d6b5e5
>>> b38b51%40googlegroups.com
>>> <https://groups.google.com/d/msgid/google-visualization-api/098b753c-adbd-4caf-a30f-d6b5e5b38b51%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2>
>> [email protected]   5CC, Cambridge MA
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Visualization API" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to google-visualization-api@
> googlegroups.com.
> Visit this group at https://groups.google.com/
> group/google-visualization-api.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-visualization-api/c673dfaf-b8a6-4e06-bec4-
> 0c28dac47b5c%40googlegroups.com
> <https://groups.google.com/d/msgid/google-visualization-api/c673dfaf-b8a6-4e06-bec4-0c28dac47b5c%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2>
[email protected] <[email protected]>   5CC, Cambridge MA

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/CAOtcSJPn%2B3hk%3DqqeLzMLwh7f70y7z_6sXF%3Dp7M-0r-QrCPNvOA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to