Re: [visualization-api] Greying out legends not working for new google.charts.Line charts

2015-07-07 Thread pavankumar c
ok thanks. Any idea when can it be released? any other alternatives?

On Tue, Jul 7, 2015 at 3:30 PM, 'Sergey Grabkovsky' via Google
Visualization API google-visualization-api@googlegroups.com wrote:

 Hi,

 The Material charts don't yet support the option to change a particular
 series color.

 On Mon, Jul 6, 2015 at 11:09 AM Pavankumar C pavan...@gmail.com wrote:

 Hi ,

 I have a requirement to grey out the legends and hide the lines once user
 clicks on the legend. However, the lines are getting hidden but the legend
 is not getting greyed out. The same piece of code works with  all other
 visualization charts. The code is as below.

 google.visualization.events.addListener(chart, 'select', function () {

   var sel = chart.getSelection();
   // if selection length is 0, we deselected an element
   if (sel.length  0) {
   // if row is undefined, we clicked on the legend
   if (sel[0].row === null) {
   var col = sel[0].column;
   if (columns[col] == col) {
   // hide the data series
   columns[col] = {
   label: data.getColumnLabel(col),
   type: data.getColumnType(col),
   calc: function () {
   return null;
   }

   };
   // grey out the legend entry
   series[col - 1].color = '#CC';
   }
   else {
   // show the data series
   columns[col] = col;
   series[col - 1].color = null;
   }
  /* var view = new google.visualization.DataView(data);
   view.setColumns(columns);
   chart.draw(view, options);*/
   var view = new google.visualization.DataView(data);
   view.setColumns(columns);
   chart.draw(view, options);

   }
   }
   });

 anybody has an idea, why isnt working?

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

  --
 You received this message because you are subscribed to a topic in the
 Google Groups Google Visualization API group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/google-visualization-api/cuXjdBG6Ne0/unsubscribe
 .
 To unsubscribe from this group and all its topics, 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.




-- 
Regards,
Pavan Kumar

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


[visualization-api] Greying out legends not working for new google.charts.Line charts

2015-07-06 Thread Pavankumar C
Hi ,

I have a requirement to grey out the legends and hide the lines once user 
clicks on the legend. However, the lines are getting hidden but the legend 
is not getting greyed out. The same piece of code works with  all other 
visualization charts. The code is as below. 

google.visualization.events.addListener(chart, 'select', function () {

  var sel = chart.getSelection();
  // if selection length is 0, we deselected an element
  if (sel.length  0) {
  // if row is undefined, we clicked on the legend
  if (sel[0].row === null) {
  var col = sel[0].column;
  if (columns[col] == col) {
  // hide the data series
  columns[col] = {
  label: data.getColumnLabel(col),
  type: data.getColumnType(col),
  calc: function () {
  return null;
  }
 
  };
  // grey out the legend entry
  series[col - 1].color = '#CC';
  }
  else {
  // show the data series
  columns[col] = col;
  series[col - 1].color = null;
  }
 /* var view = new google.visualization.DataView(data);
  view.setColumns(columns);
  chart.draw(view, options);*/
  var view = new google.visualization.DataView(data);
  view.setColumns(columns);
  chart.draw(view, options);

  }
  }
  });

anybody has an idea, why isnt working? 

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