Hi Kiran,

You have a couple problems with your data.  First the arrayToDataTable
function expects an array of arrays, not an array of objects.   Here is the
documentation for this function:
https://developers.google.com/chart/interactive/docs/reference#arraytodatatable

Second, the values are not formatted properly.  Your numbers need to be not
in quotes, and your dates need to be either constructed with JavaScript new
Date(), or use the string notation in this form: "Date(year, month, day)".
Note the month index is 0-based.  See more about dates and times here:
https://developers.google.com/chart/interactive/docs/datesandtimes

On Wed, Nov 4, 2015 at 4:24 AM, Kiran Kumar <[email protected]> wrote:

> I am using Google charts for the first time so please excuse if this is a
> dumb question .
> I have got this  issue .
>
> I am trying to display *OHLC* values in Google Visualization candle Stick
> charts and this is my code
>
> var data_value = [
>     {
>         "date": "2011-08-01",
>         "open": "136.65",
>         "high": "136.96",
>         "low": "134.15",
>         "close": "136.49"
>     },
>     {
>         "date": "2011-08-02",
>         "open": "135.26",
>         "high": "135.95",
>         "low": "131.50",
>         "close": "131.85"
>     },
>     {
>         "date": "2011-08-05",
>         "open": "132.90",
>         "high": "135.27",
>         "low": "128.30",
>         "close": "135.25"
>     }];
>
>  google.setOnLoadCallback(drawChart);
>   function drawChart() {
>     var data = google.visualization.arrayToDataTable([
>      data_value
>     ], true);
>
>     var options = {
>       legend:'none'
>     };
>
>     var chart = new 
> google.visualization.CandlestickChart(document.getElementById('chart_div'));
>
>     chart.draw(data, options);
>   }
>
>
> I am trying to draw Candlestick Charts using Google Charting API .
>
> I have got OHLC data in an array format as shown
>
> But when i am trying to draw the chart , i am getting the following exception 
> in browser console
>
> *Unknown type of value in 0,0*
>
> Could you please let me know how to resolve this issue ??
>
> and this is my fiddle
>
> http://jsfiddle.net/8gcr0xe9/4/
>
> --
> 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
> http://groups.google.com/group/google-visualization-api.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-visualization-api/6da2315d-390a-4d11-af6f-f4847f4e1a7f%40googlegroups.com
> <https://groups.google.com/d/msgid/google-visualization-api/6da2315d-390a-4d11-af6f-f4847f4e1a7f%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>  -
978-394-1058
[email protected] <[email protected]>   5CC, Cambridge MA
[email protected] <[email protected]> 9 Juniper Ridge
Road, Acton 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 http://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/CAOtcSJOV_DGQtZiyQgE%2BkQ4mKLwPvcCzJTySwJbPibaWy1LacQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to