[visualization-api] Re: Swiss currencies

2016-02-19 Thread Gibono
Ok Thank you

Le vendredi 19 février 2016 15:55:05 UTC+1, Gibono a écrit :
>
> Hi,
> I'm trying to display an amount of swiss francs, but I don't find the 
> langage associated to Swiss Francs. How can I change the local currency to 
> swiss francs?
>
> Here is my code:
>
> google.charts.load('current', {'packages':['corechart'], 'language': 'CH'
> });
> google.charts.setOnLoadCallback(drawChart);
>
>  function drawChart() {
>  var jsonData1 = $.ajax({
>  url: "x.php",
>  dataType: "json",
>  async: false
>  }).responseText;
>  var data1 = new google.visualization.DataTable(jsonData1);
>
>  var options1 = {
>  title : 'Total money',
>  vAxis: {title: 'CHF', format: 'currency'},
>  hAxis: {title: 'Month'},
>  seriesType: 'bars',
>  series: {}
>  };
>
>  options1.series[data1.getNumberOfColumns()-2] = {type: 'line'};
>
>  var chart = new google.visualization.ComboChart(document.getElementById(
> 'chart'));
>  chart.draw(data1, options1);  
> }
>
> Thank you very much for the answers. 
>

-- 
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 google-visualization-api+unsubscr...@googlegroups.com.
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/7482c9a8-30a3-4e8a-a63c-9eb80709315b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[visualization-api] Swiss currencies

2016-02-19 Thread Gibono
Hi,
I'm trying to display an amount of swiss francs, but I don't find the 
langage associated to Swiss Francs. How can I change the local currency to 
swiss francs?

Here is my code:

google.charts.load('current', {'packages':['corechart'], 'language': 'CH'});
google.charts.setOnLoadCallback(drawChart);

 function drawChart() {
 var jsonData1 = $.ajax({
 url: "x.php",
 dataType: "json",
 async: false
 }).responseText;
 var data1 = new google.visualization.DataTable(jsonData1);

 var options1 = {
 title : 'Total money',
 vAxis: {title: 'CHF', format: 'currency'},
 hAxis: {title: 'Month'},
 seriesType: 'bars',
 series: {}
 };

 options1.series[data1.getNumberOfColumns()-2] = {type: 'line'};

 var chart = new google.visualization.ComboChart(document.getElementById(
'chart'));
 chart.draw(data1, options1);  
}

Thank you very much for the answers. 

-- 
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 google-visualization-api+unsubscr...@googlegroups.com.
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/00cefd00-d676-4746-9723-f106732125f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [visualization-api] Dynamic options series reference

2016-02-18 Thread Gibono
Found it:

data.getNumberOfColumns()

Le jeudi 18 février 2016 15:55:30 UTC+1, Gibono a écrit :
>
> Uhm I'me greedy...
>
> Is there a way to get the last index?
>
> Le jeudi 18 février 2016 15:52:58 UTC+1, Gibono a écrit :
>>
>> Works like a charm.
>>
>> THANKS!
>>
>> Le jeudi 18 février 2016 15:38:37 UTC+1, Daniel LaLiberte a écrit :
>>>
>>> You can't do it quite like that, though in the future, we could probably 
>>> support referencing a series by its column id.  Instead, you'll need to do 
>>> something like this:
>>>
>>>
>>>
>>> var options = {
>>>title : 'My graph',
>>>vAxis: {title: 'CHF'},
>>>hAxis: {title: 'Month'},
>>>seriesType: 'bars',
>>>series: {}
>>> };
>>> options.series[nbYears] = {type: 'line'};
>>>
>>>
>>> On Thu, Feb 18, 2016 at 9:26 AM, Gibono  wrote:
>>>
>>>> Hi,
>>>>
>>>> I've got a dynamic DataTable (the number of columns is not fix => 
>>>> database related).
>>>>
>>>> Here is an exemple of the dataTable:
>>>>
>>>> {
>>>>  "cols": [{
>>>>  "id": "Month",
>>>>  "label": "Month",
>>>>  "type": "string"
>>>>  }, {
>>>>  "id": "2015",
>>>>  "label": "2015",
>>>>  "type": "number"
>>>>  }, {
>>>>  "id": "Average",
>>>>  "label": "Average",
>>>>  "type": "number"
>>>>  }],
>>>>  "rows": [{
>>>>  "c": [{
>>>>  "v": "January"
>>>>  }, {
>>>>  "v": 1
>>>>  }, {
>>>>  "v": 1
>>>>  }]
>>>>  }, {
>>>>  "c": [{
>>>>  "v": "February"
>>>>  }, {
>>>>  "v": 2
>>>>  }, {
>>>>  "v": 2
>>>>  }]
>>>>  }]
>>>> }
>>>>
>>>> or
>>>>
>>>> {
>>>>  "cols": [{
>>>>  "id": "Month",
>>>>  "label": "Month",
>>>>  "type": "string"
>>>>  }, {
>>>>  "id": "2015",
>>>>  "label": "2015",
>>>>  "type": "number"
>>>>  },
>>>>  {
>>>>  "id": "2016",
>>>>  "label": "2016",
>>>>  "type": "number"
>>>>  }, {
>>>>  "id": "Average",
>>>>  "label": "Average",
>>>>  "type": "number"
>>>>  }],
>>>>  "rows": [{
>>>>  "c": [{
>>>>  "v": "January"
>>>>  }, {
>>>>  "v": 1
>>>>  }, {
>>>>  "v": 1
>>>>  }]
>>>>  }, {
>>>>  "c": [{
>>>>  "v": "February"
>>>>  }, {
>>>>  "v": 2
>>>>  }, {
>>>>  "v": 2
>>>>  }]
>>>>  }]
>>>> }
>>>>
>>>> So it depends of the number of years
>>>>
>>>>
>>>> I'd like to do somehting like this:
>>>>
>>>> var firstYear = 2015;
>>>> var data = new google.visualization.DataTable(jsonData);
>>>> var curYear = new Date().getFullYear();
>>>> var nbYears= (curYear-firstYear)+1;
>>>>
>>>> var options = {
>>>>   title : 'My graph',
>>>>   vAxis: {title: 'CHF'},
>>>>   hAxis: {title: 'Month'},
>>>>   seriesType: 'bars',
>>>>   series: {nbYears: {type: 'line'}}
>>>> };
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> or
>>>>
>>>>
>>>> var options = {
>>>>title : 'My graph',
>>>>vAxis: {title: 'CHF'},
>>>>hAxis: {title: 'Month'},
>>>>seriesType: 'bars',
>>>>series: {lastIndex: {type: 'line'}}
>>>> };
>>>>
>>>> or
>>>>
>>>> var options = {
>>>>title : 'My graph',
>>>>vAxis: {title: 'CHF'},
>>>>hAxis: {title: 'Month'},
>>>>seriesType: 'bars',
>>>>series: {'Average': {type: 'line'}}
>>>> };
>>>>
>>>>
>>>> How can I do that?`
>>>>
>>>> Thanks for the answers.
>>>>
>>>> -- 
>>>> 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 google-visualization-api+unsubscr...@googlegroups.com.
>>>> To post to this group, send email to google-visua...@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/1bf7ea1d-9614-44d8-88fa-cc6eceb6f451%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/google-visualization-api/1bf7ea1d-9614-44d8-88fa-cc6eceb6f451%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>
>>> dlali...@google.com   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 google-visualization-api+unsubscr...@googlegroups.com.
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/0a0b4d54-ec43-470a-a59f-462f0beed879%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [visualization-api] Dynamic options series reference

2016-02-18 Thread Gibono
Uhm I'me greedy...

Is there a way to get the last index?

Le jeudi 18 février 2016 15:52:58 UTC+1, Gibono a écrit :
>
> Works like a charm.
>
> THANKS!
>
> Le jeudi 18 février 2016 15:38:37 UTC+1, Daniel LaLiberte a écrit :
>>
>> You can't do it quite like that, though in the future, we could probably 
>> support referencing a series by its column id.  Instead, you'll need to do 
>> something like this:
>>
>>
>>
>> var options = {
>>title : 'My graph',
>>vAxis: {title: 'CHF'},
>>hAxis: {title: 'Month'},
>>seriesType: 'bars',
>>series: {}
>> };
>> options.series[nbYears] = {type: 'line'};
>>
>>
>> On Thu, Feb 18, 2016 at 9:26 AM, Gibono  wrote:
>>
>>> Hi,
>>>
>>> I've got a dynamic DataTable (the number of columns is not fix => 
>>> database related).
>>>
>>> Here is an exemple of the dataTable:
>>>
>>> {
>>>  "cols": [{
>>>  "id": "Month",
>>>  "label": "Month",
>>>  "type": "string"
>>>  }, {
>>>  "id": "2015",
>>>  "label": "2015",
>>>  "type": "number"
>>>  }, {
>>>  "id": "Average",
>>>  "label": "Average",
>>>  "type": "number"
>>>  }],
>>>  "rows": [{
>>>  "c": [{
>>>  "v": "January"
>>>  }, {
>>>  "v": 1
>>>  }, {
>>>  "v": 1
>>>  }]
>>>  }, {
>>>  "c": [{
>>>  "v": "February"
>>>  }, {
>>>  "v": 2
>>>  }, {
>>>  "v": 2
>>>  }]
>>>  }]
>>> }
>>>
>>> or
>>>
>>> {
>>>  "cols": [{
>>>  "id": "Month",
>>>  "label": "Month",
>>>  "type": "string"
>>>  }, {
>>>  "id": "2015",
>>>  "label": "2015",
>>>  "type": "number"
>>>  },
>>>  {
>>>  "id": "2016",
>>>  "label": "2016",
>>>  "type": "number"
>>>  }, {
>>>  "id": "Average",
>>>  "label": "Average",
>>>  "type": "number"
>>>  }],
>>>  "rows": [{
>>>  "c": [{
>>>  "v": "January"
>>>  }, {
>>>  "v": 1
>>>  }, {
>>>  "v": 1
>>>  }]
>>>  }, {
>>>  "c": [{
>>>  "v": "February"
>>>  }, {
>>>  "v": 2
>>>  }, {
>>>  "v": 2
>>>  }]
>>>  }]
>>> }
>>>
>>> So it depends of the number of years
>>>
>>>
>>> I'd like to do somehting like this:
>>>
>>> var firstYear = 2015;
>>> var data = new google.visualization.DataTable(jsonData);
>>> var curYear = new Date().getFullYear();
>>> var nbYears= (curYear-firstYear)+1;
>>>
>>> var options = {
>>>   title : 'My graph',
>>>   vAxis: {title: 'CHF'},
>>>   hAxis: {title: 'Month'},
>>>   seriesType: 'bars',
>>>   series: {nbYears: {type: 'line'}}
>>> };
>>>
>>>
>>>
>>>
>>>
>>> or
>>>
>>>
>>> var options = {
>>>title : 'My graph',
>>>vAxis: {title: 'CHF'},
>>>hAxis: {title: 'Month'},
>>>seriesType: 'bars',
>>>series: {lastIndex: {type: 'line'}}
>>> };
>>>
>>> or
>>>
>>> var options = {
>>>title : 'My graph',
>>>vAxis: {title: 'CHF'},
>>>hAxis: {title: 'Month'},
>>>seriesType: 'bars',
>>>series: {'Average': {type: 'line'}}
>>> };
>>>
>>>
>>> How can I do that?`
>>>
>>> Thanks for the answers.
>>>
>>> -- 
>>> 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 google-visualization-api+unsubscr...@googlegroups.com.
>>> To post to this group, send email to google-visua...@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/1bf7ea1d-9614-44d8-88fa-cc6eceb6f451%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/google-visualization-api/1bf7ea1d-9614-44d8-88fa-cc6eceb6f451%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>
>> dlali...@google.com   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 google-visualization-api+unsubscr...@googlegroups.com.
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/fd54aa14-792a-4025-8615-4a87325730d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [visualization-api] Dynamic options series reference

2016-02-18 Thread Gibono
Works like a charm.

THANKS!

Le jeudi 18 février 2016 15:38:37 UTC+1, Daniel LaLiberte a écrit :
>
> You can't do it quite like that, though in the future, we could probably 
> support referencing a series by its column id.  Instead, you'll need to do 
> something like this:
>
>
>
> var options = {
>title : 'My graph',
>vAxis: {title: 'CHF'},
>hAxis: {title: 'Month'},
>seriesType: 'bars',
>series: {}
> };
> options.series[nbYears] = {type: 'line'};
>
>
> On Thu, Feb 18, 2016 at 9:26 AM, Gibono > 
> wrote:
>
>> Hi,
>>
>> I've got a dynamic DataTable (the number of columns is not fix => 
>> database related).
>>
>> Here is an exemple of the dataTable:
>>
>> {
>>  "cols": [{
>>  "id": "Month",
>>  "label": "Month",
>>  "type": "string"
>>  }, {
>>  "id": "2015",
>>  "label": "2015",
>>  "type": "number"
>>  }, {
>>  "id": "Average",
>>  "label": "Average",
>>  "type": "number"
>>  }],
>>  "rows": [{
>>  "c": [{
>>  "v": "January"
>>  }, {
>>  "v": 1
>>  }, {
>>  "v": 1
>>  }]
>>  }, {
>>  "c": [{
>>  "v": "February"
>>  }, {
>>  "v": 2
>>  }, {
>>  "v": 2
>>  }]
>>  }]
>> }
>>
>> or
>>
>> {
>>  "cols": [{
>>  "id": "Month",
>>  "label": "Month",
>>  "type": "string"
>>  }, {
>>  "id": "2015",
>>  "label": "2015",
>>  "type": "number"
>>  },
>>  {
>>  "id": "2016",
>>  "label": "2016",
>>  "type": "number"
>>  }, {
>>  "id": "Average",
>>  "label": "Average",
>>  "type": "number"
>>  }],
>>  "rows": [{
>>  "c": [{
>>  "v": "January"
>>  }, {
>>  "v": 1
>>  }, {
>>  "v": 1
>>  }]
>>  }, {
>>  "c": [{
>>  "v": "February"
>>  }, {
>>  "v": 2
>>  }, {
>>  "v": 2
>>  }]
>>  }]
>> }
>>
>> So it depends of the number of years
>>
>>
>> I'd like to do somehting like this:
>>
>> var firstYear = 2015;
>> var data = new google.visualization.DataTable(jsonData);
>> var curYear = new Date().getFullYear();
>> var nbYears= (curYear-firstYear)+1;
>>
>> var options = {
>>   title : 'My graph',
>>   vAxis: {title: 'CHF'},
>>   hAxis: {title: 'Month'},
>>   seriesType: 'bars',
>>   series: {nbYears: {type: 'line'}}
>> };
>>
>>
>>
>>
>>
>> or
>>
>>
>> var options = {
>>title : 'My graph',
>>vAxis: {title: 'CHF'},
>>hAxis: {title: 'Month'},
>>seriesType: 'bars',
>>series: {lastIndex: {type: 'line'}}
>> };
>>
>> or
>>
>> var options = {
>>title : 'My graph',
>>vAxis: {title: 'CHF'},
>>hAxis: {title: 'Month'},
>>seriesType: 'bars',
>>series: {'Average': {type: 'line'}}
>> };
>>
>>
>> How can I do that?`
>>
>> Thanks for the answers.
>>
>> -- 
>> 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 google-visualization-api+unsubscr...@googlegroups.com 
>> .
>> To post to this group, send email to google-visua...@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/1bf7ea1d-9614-44d8-88fa-cc6eceb6f451%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/google-visualization-api/1bf7ea1d-9614-44d8-88fa-cc6eceb6f451%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>
> dlali...@google.com5CC, 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 google-visualization-api+unsubscr...@googlegroups.com.
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/1f832a23-bb73-434d-a7bb-c133a5c454b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[visualization-api] Dynamic options series reference

2016-02-18 Thread Gibono
Hi,

I've got a dynamic DataTable (the number of columns is not fix => database 
related).

Here is an exemple of the dataTable:

{
 "cols": [{
 "id": "Month",
 "label": "Month",
 "type": "string"
 }, {
 "id": "2015",
 "label": "2015",
 "type": "number"
 }, {
 "id": "Average",
 "label": "Average",
 "type": "number"
 }],
 "rows": [{
 "c": [{
 "v": "January"
 }, {
 "v": 1
 }, {
 "v": 1
 }]
 }, {
 "c": [{
 "v": "February"
 }, {
 "v": 2
 }, {
 "v": 2
 }]
 }]
}

or

{
 "cols": [{
 "id": "Month",
 "label": "Month",
 "type": "string"
 }, {
 "id": "2015",
 "label": "2015",
 "type": "number"
 },
 {
 "id": "2016",
 "label": "2016",
 "type": "number"
 }, {
 "id": "Average",
 "label": "Average",
 "type": "number"
 }],
 "rows": [{
 "c": [{
 "v": "January"
 }, {
 "v": 1
 }, {
 "v": 1
 }]
 }, {
 "c": [{
 "v": "February"
 }, {
 "v": 2
 }, {
 "v": 2
 }]
 }]
}

So it depends of the number of years


I'd like to do somehting like this:

var firstYear = 2015;
var data = new google.visualization.DataTable(jsonData);
var curYear = new Date().getFullYear();
var nbYears= (curYear-firstYear)+1;
   
var options = {
  title : 'My graph',
  vAxis: {title: 'CHF'},
  hAxis: {title: 'Month'},
  seriesType: 'bars',
  series: {nbYears: {type: 'line'}}
};





or


var options = {
   title : 'My graph',
   vAxis: {title: 'CHF'},
   hAxis: {title: 'Month'},
   seriesType: 'bars',
   series: {lastIndex: {type: 'line'}}
};

or

var options = {
   title : 'My graph',
   vAxis: {title: 'CHF'},
   hAxis: {title: 'Month'},
   seriesType: 'bars',
   series: {'Average': {type: 'line'}}
};


How can I do that?`

Thanks for the answers.

-- 
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 google-visualization-api+unsubscr...@googlegroups.com.
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/1bf7ea1d-9614-44d8-88fa-cc6eceb6f451%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.