I am facing issue while implementing *'ChartRangeFilter'* control in google 
charts which uses date field as a Range filter. I am fetching data from 
MySQL database using JSON approach (JSON encoded data) and using it in view 
to render Line Chart in my Laravel application.


If I use Date field as String data type then it works but then I can not 
implement *'ChartRangeFilter'* as it only works with number and data type 
fields and due to this I have hard-coded whole data in my view with Date 
constructor. e.g.new Date(Year, Month, Day).


But hard-coding data is not feasible solution hence is there any 
alternative solution available in which I can use JSON encoded date field 
in *'ChartRangeFilter'*in google charts?

Here is my code snippet along with table schema.




function drawChart() {


var jsonData = $.ajax({

url: 'get_tests',

contentType: 'application/json',

dataType: 'json',

async: false

}).responseText;



var data = new google.visualization.DataTable(jQuery.parseJSON(jsonData));


  

   // var data = new google.visualization.DataTable(obj);

    // create chart

    var chart = new 
google.visualization.LineChart(document.getElementById('chart_div'));

    

    chart.draw(data);

    

}


Data-table Schema:


Column label    Format

Datetime            date

Buy                    number

Sell                     number

-- 
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/eb6a645b-f94c-4358-b666-cd3a0a668d36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to