line chart unit should be in english not in german

29 views
Skip to first unread message

Nadja

unread,
Mar 7, 2016, 12:33:07 PM3/7/16
to Google Visualization API
Hello,

I have a line chart.
If the numbers are very big, it is shown like this "24Tsd.". but "Tsd." is german, isn't it? How can I change it to english?
Thank you very much
Nadja

Sergey Grabkovsky

unread,
Mar 7, 2016, 12:43:18 PM3/7/16
to Google Visualization API
Hi Nadja,

Could you please post some sample code where you see this issue?

--
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-visualizati...@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/405964a6-3fea-43b0-ba80-63a4ca7cf475%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

unnamed.gif

Sergey Grabkovsky

Software Engineer

Google, Inc

gra...@google.com


Nadja

unread,
Mar 7, 2016, 12:50:18 PM3/7/16
to Google Visualization API
The graph is in a proteced area. But I have a image for you.
I hope it will help.
Nadja
dt-unit.jpg

Sergey Grabkovsky

unread,
Mar 7, 2016, 12:53:07 PM3/7/16
to Google Visualization API
Hi Nadja,

The image is not helpful. But without the code available, I'll attempt to guess at what's wrong.

Most probably, this issue stems from specifying a language code when calling .load.

The next most probable reason is that you're using google.load (instead of google.charts.load) along with the old loader (www.google.com/jsapi), which will attempt to auto-detect your locale.

I'm afraid I can offer no other guesses without seeing the code.

--
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-visualizati...@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.

For more options, visit https://groups.google.com/d/optout.

Nadja

unread,
Mar 7, 2016, 12:57:11 PM3/7/16
to Google Visualization API
The code is like this:
 <script type="text/javascript">
    google
.load('visualization', '1.1', {packages: ['line']});
    google
.setOnLoadCallback(drawChart);

   
function drawChart() {

     
var data = new google.visualization.DataTable();
      data
.addColumn('string', 'Time');
     
if(<?php if(isset($cha1)) echo $cha1; else echo "0"; ?>==1) {data.addColumn('number', 'Zone 1');}
     
if(<?php if(isset($cha2)) echo $cha2; else echo "0"; ?>==1){ data.addColumn('number', 'Zone 2');}
     
if(<?php if(isset($cha3)) echo $cha3; else echo "0"; ?>==1) {data.addColumn('number', 'Zone 3');}
     
if(<?php if(isset($temp)) echo $temp; else echo "0"; ?>==1) {data.addColumn('number', 'Temp');}
     
     data
.addRows(<?php echo $chart_data ?>);
   
   
//alle WErte
     
if(<?php if(isset($axe)) echo $axe; else echo "0"; ?>==1){  
     
var options = {
        chart
: {
          title
: 'Data'
       
},
       
        height
:600,        
        chartArea
:{left:30,top:30,width:'100%',height:600},
        series
: {
         
// Gives each series an axis name that matches the Y-axis below.
         
         
0: {axis: 'ppm'},
         
1:{axis: 'ppm'},
         
2:{axis: 'ppm'},
         
3:{axis: 'C'},
         
       
},
        axes
: {
         
// Adds labels to each axis; they don't have to match the axis names.
         y
: {
            ppm
: {label: '<?php echo $unitaktuell ?>'},
            C
: {label: '°C'}

         
}
       
}

     
};} var chart = new google.charts.Line(document.getElementById('linechart_material'));

      chart
.draw(data, options);
   
}
   
   
// Make the charts responsive
      jQuery
(document).ready(function(){
        jQuery
(window).resize(function(){
          drawChart
();
       
});
     
});

 
</script>



Am Montag, 7. März 2016 18:33:07 UTC+1 schrieb Nadja:

Sergey Grabkovsky

unread,
Mar 7, 2016, 12:59:17 PM3/7/16
to Google Visualization API
It appears to be as I've guessed. You're still using the old loader (google.load). Please follow the instructions in our documentation and let me know if it helps.

--
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-visualizati...@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.

For more options, visit https://groups.google.com/d/optout.

Nadja

unread,
Mar 7, 2016, 1:03:18 PM3/7/16
to Google Visualization API
Thank you very much.
I will try it tomorrow.
I am right, that the API set the language to my location?
If it is like that, it is no problem I only need the units in other countries not in german.
Nadja


Am Montag, 7. März 2016 18:33:07 UTC+1 schrieb Nadja:

Sergey Grabkovsky

unread,
Mar 7, 2016, 1:05:11 PM3/7/16
to Google Visualization API
The old loader has the capability to set the language based on signals like your location (although I'm not sure that it actually uses your location), so yes you're correct: these charts will look different for users in other locales.

--
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-visualizati...@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.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages