Re: [visualization-api] Sorting the date descending on graph.

2015-06-08 Thread Michael S
Thanks for yor answer.

Domain Data it my X Axis, so Date?
Can you please write what should i do in code how to use this 'directon' 
option.

Thanks one more time.

понедельник, 8 июня 2015 г., 14:27:31 UTC+2 пользователь Daniel LaLiberte 
написал:

 Michael,

 Your domain data should generally be in ascending order, and then you can 
 use the 'direction' option on the domain axis (hAxis for you) to switch the 
 direction of that axis.

 On Sat, Jun 6, 2015 at 9:08 AM, Michael S m...@sandakov.ru javascript: 
 wrote:

 Hello!

 Please tell me how can i sort date descending.

 I give the date already sorted as descending (from 06 Jan till 03 Jan) 
 but API sorts this date acsending on graph (from 03 Jan till 06 Jan). 

 I get:


 https://lh3.googleusercontent.com/-KiR96H_6qUA/VXLwg4uT4gI/Bho/vhtUpTgO41k/s1600/Screenshot_5.jpg

 Here is my code 

 script type=text/javascript
   google.load('visualization', '1', {packages: ['corechart', 
 'line']});
 google.setOnLoadCallback(drawTrendlines);

 function drawTrendlines() {
   var data = new google.visualization.DataTable();
   data.addColumn('date', 'Time of Day');
   data.addColumn('number', 'Dogs');

   data.addRows([
   [new Date ('Jun 06, 2015'), 0],[new Date ('Jun 05, 2015'), 4],[new 
 Date ('Jun 04, 2015'), 3],[new Date ('Jun 03, 2015'), 4]
   
   ]);

   data.sort([{column: 0, desc: true}, {column: 1, desc: true}]);

   var options = {
hAxis: {
 format: 'd/M/yy',
   },
 vAxis: {
   title: 'Popularity'
 },
 colors: ['#AB0D06', '#007329'],
 trendlines: {
   0: {type: 'linear', color: '#111', opacity: .3}
 }
   };

   var chart = new 
 google.visualization.LineChart(document.getElementById('chart_div1'));
   chart.draw(data, options);
 }

   /script

 div id=chart_div1/div


 Thanks a lot!

 -- 
 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 
 javascript:.
 To post to this group, send email to google-visua...@googlegroups.com 
 javascript:.
 Visit this group at 
 http://groups.google.com/group/google-visualization-api.
 For more options, visit https://groups.google.com/d/optout.




 -- 
 Daniel LaLiberte https://plus.google.com/100631381223468223275?prsrc=2 
  - 978-394-1058
 dlali...@google.com javascript:   5CC, Cambridge MA
 daniel.l...@gmail.com javascript: 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 google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.


Re: [visualization-api] Sorting the date descending on graph.

2015-06-08 Thread Michael S
It works!
Thanks a lot!!!

понедельник, 8 июня 2015 г., 15:14:46 UTC+2 пользователь Daniel LaLiberte 
написал:



 hAxis.direction

 The direction in which the values along the horizontal axis grow. Specify 
 -1 to reverse the order of the values.
 Type: 1 or -1
 Default: 1


 hAxis: {
 format: 'd/M/yy',
 direction: -1
   },


 On Mon, Jun 8, 2015 at 8:38 AM, Michael S m...@sandakov.ru javascript: 
 wrote:

 Thanks for yor answer.

 Domain Data it my X Axis, so Date?
 Can you please write what should i do in code how to use this 'directon' 
 option.

 Thanks one more time.

 понедельник, 8 июня 2015 г., 14:27:31 UTC+2 пользователь Daniel LaLiberte 
 написал:

 Michael,

 Your domain data should generally be in ascending order, and then you 
 can use the 'direction' option on the domain axis (hAxis for you) to switch 
 the direction of that axis.

 On Sat, Jun 6, 2015 at 9:08 AM, Michael S m...@sandakov.ru wrote:

 Hello!

 Please tell me how can i sort date descending.

 I give the date already sorted as descending (from 06 Jan till 03 Jan) 
 but API sorts this date acsending on graph (from 03 Jan till 06 Jan). 

 I get:


 https://lh3.googleusercontent.com/-KiR96H_6qUA/VXLwg4uT4gI/Bho/vhtUpTgO41k/s1600/Screenshot_5.jpg

 Here is my code 

 script type=text/javascript
   google.load('visualization', '1', {packages: ['corechart', 
 'line']});
 google.setOnLoadCallback(drawTrendlines);

 function drawTrendlines() {
   var data = new google.visualization.DataTable();
   data.addColumn('date', 'Time of Day');
   data.addColumn('number', 'Dogs');

   data.addRows([
   [new Date ('Jun 06, 2015'), 0],[new Date ('Jun 05, 2015'), 
 4],[new Date ('Jun 04, 2015'), 3],[new Date ('Jun 03, 2015'), 4]
   
   ]);

   data.sort([{column: 0, desc: true}, {column: 1, desc: true}]);

   var options = {
hAxis: {
 format: 'd/M/yy',
   },
 vAxis: {
   title: 'Popularity'
 },
 colors: ['#AB0D06', '#007329'],
 trendlines: {
   0: {type: 'linear', color: '#111', opacity: .3}
 }
   };

   var chart = new 
 google.visualization.LineChart(document.getElementById('chart_div1'));
   chart.draw(data, options);
 }

   /script

 div id=chart_div1/div


 Thanks a lot!

 -- 
 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 
 http://groups.google.com/group/google-visualization-api.
 For more options, visit https://groups.google.com/d/optout.




 -- 
 Daniel LaLiberte https://plus.google.com/100631381223468223275?prsrc=2
   - 978-394-1058
 dlali...@google.com   5CC, Cambridge MA
 daniel.l...@gmail.com 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 google-visualization-api+unsubscr...@googlegroups.com 
 javascript:.
 To post to this group, send email to google-visua...@googlegroups.com 
 javascript:.
 Visit this group at 
 http://groups.google.com/group/google-visualization-api.
 For more options, visit https://groups.google.com/d/optout.




 -- 
 Daniel LaLiberte https://plus.google.com/100631381223468223275?prsrc=2 
  - 978-394-1058
 dlali...@google.com javascript:   5CC, Cambridge MA
 daniel.l...@gmail.com javascript: 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 google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.


Re: [visualization-api] Sorting the date descending on graph.

2015-06-08 Thread 'Daniel LaLiberte' via Google Visualization API
hAxis.direction

The direction in which the values along the horizontal axis grow. Specify -1 to
reverse the order of the values.
Type: 1 or -1
Default: 1


hAxis: {
format: 'd/M/yy',
direction: -1
  },


On Mon, Jun 8, 2015 at 8:38 AM, Michael S m...@sandakov.ru wrote:

 Thanks for yor answer.

 Domain Data it my X Axis, so Date?
 Can you please write what should i do in code how to use this 'directon'
 option.

 Thanks one more time.

 понедельник, 8 июня 2015 г., 14:27:31 UTC+2 пользователь Daniel LaLiberte
 написал:

 Michael,

 Your domain data should generally be in ascending order, and then you can
 use the 'direction' option on the domain axis (hAxis for you) to switch the
 direction of that axis.

 On Sat, Jun 6, 2015 at 9:08 AM, Michael S m...@sandakov.ru wrote:

 Hello!

 Please tell me how can i sort date descending.

 I give the date already sorted as descending (from 06 Jan till 03 Jan)
 but API sorts this date acsending on graph (from 03 Jan till 06 Jan).

 I get:


 https://lh3.googleusercontent.com/-KiR96H_6qUA/VXLwg4uT4gI/Bho/vhtUpTgO41k/s1600/Screenshot_5.jpg

 Here is my code

 script type=text/javascript
   google.load('visualization', '1', {packages: ['corechart',
 'line']});
 google.setOnLoadCallback(drawTrendlines);

 function drawTrendlines() {
   var data = new google.visualization.DataTable();
   data.addColumn('date', 'Time of Day');
   data.addColumn('number', 'Dogs');

   data.addRows([
   [new Date ('Jun 06, 2015'), 0],[new Date ('Jun 05, 2015'), 4],[new
 Date ('Jun 04, 2015'), 3],[new Date ('Jun 03, 2015'), 4]

   ]);

   data.sort([{column: 0, desc: true}, {column: 1, desc: true}]);

   var options = {
hAxis: {
 format: 'd/M/yy',
   },
 vAxis: {
   title: 'Popularity'
 },
 colors: ['#AB0D06', '#007329'],
 trendlines: {
   0: {type: 'linear', color: '#111', opacity: .3}
 }
   };

   var chart = new
 google.visualization.LineChart(document.getElementById('chart_div1'));
   chart.draw(data, options);
 }

   /script

 div id=chart_div1/div


 Thanks a lot!

 --
 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
 http://groups.google.com/group/google-visualization-api.
 For more options, visit https://groups.google.com/d/optout.




 --
 Daniel LaLiberte https://plus.google.com/100631381223468223275?prsrc=2
  - 978-394-1058
 dlali...@google.com   5CC, Cambridge MA
 daniel.l...@gmail.com 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 google-visualization-api+unsubscr...@googlegroups.com.
 To post to this group, send email to
 google-visualization-api@googlegroups.com.
 Visit this group at
 http://groups.google.com/group/google-visualization-api.
 For more options, visit https://groups.google.com/d/optout.




-- 
Daniel LaLiberte https://plus.google.com/100631381223468223275?prsrc=2  -
978-394-1058
dlalibe...@google.com dlalibe...@google.com   5CC, Cambridge MA
daniel.lalibe...@gmail.com daniel.lalibe...@gmail.com 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 google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.