Como retornar a data_semanal?
De:
Date(1409626800000)
Para:
data.addRows([
[1409626800000, 3],
[1419626800000, 1],
[1429626800000, 1],
[1439626800000, 1],
[1449626800000, 2]
]);
Em sábado, 7 de março de 2015 07:46:46 UTC-3, Wilson Rogério Braun escreveu:
>
> Algum local ou exemplo para esta consulta?
>
> Em sexta-feira, 6 de março de 2015 16:10:20 UTC-3, Wilson Rogério Braun
> escreveu:
>>
>> Até ai acho que estou entendendo, obrigado, mas como retornar do banco
>> desta forma?
>>
>> Em sexta-feira, 6 de março de 2015 15:29:01 UTC-3, Sergey escreveu:
>>>
>>> Here is a basic example: http://jsfiddle.net/vc36osx3/
>>>
>>> On Fri, Mar 6, 2015 at 1:12 PM Wilson Rogério Braun <[email protected]>
>>> wrote:
>>>
>>>> Teria algum exemplo para aplicar a sugestão?
>>>>
>>>>
>>>> Em sexta-feira, 6 de março de 2015 11:09:40 UTC-3, Wilson Rogério Braun
>>>> escreveu:
>>>>
>>>>> *Alguém tem alguma sugestão?*
>>>>>
>>>>> *Controler:*
>>>>> public ActionResult Peso()
>>>>> {
>>>>> var dia = db.spPesoEvolucao().ToList();
>>>>> var a = dia.Select(x => new { x.data_semanal, x.peso_kg });
>>>>> return Json(a, JsonRequestBehavior.AllowGet);
>>>>> }
>>>>>
>>>>> *View:*
>>>>>
>>>>> <script type="text/javascript"
>>>>> src="https://www.google.com/jsapi"></script><script
>>>>> type="text/javascript"
>>>>> src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
>>>>>
>>>>> <!-- Script-->
>>>>> <script type="text/javascript">
>>>>> google.load('visualization', '1', { 'packages': ['corechart'] });
>>>>> google.setOnLoadCallback(drawChart);
>>>>> function drawChart() {
>>>>> $.get('/Programa/Peso', {},
>>>>> function (data) {
>>>>> var tdata = new google.visualization.DataTable();
>>>>> tdata.addColumn('date', 'data_semanal');
>>>>> tdata.addColumn('number', 'peso_kg');
>>>>> //tdata.addColumn({ type: 'string', role:
>>>>> 'annotation' });
>>>>> console.log(data);
>>>>> for (var i = 0; i < data.length; i++) {
>>>>> if (data[i].data_semanal != null)
>>>>> tdata.addRow([data[i].data_semanal,
>>>>> data[i].peso_kg]);
>>>>> }
>>>>> var options = {
>>>>> vAxis: { title: "PESO", minValue: 1 },
>>>>> hAxis: { title: "DATA", textStyle: { fontSize: 10
>>>>>
>>>>> ...
>>>>
>>>> --
>>>> 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.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
--
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.
For more options, visit https://groups.google.com/d/optout.