google / google-visualization-issues

288 stars 35 forks source link

role: 'style' not working #2460

Open ikishanoza opened 7 years ago

ikishanoza commented 7 years ago

i use following function to draw a chart but the 'role:style' not showing any effects. here is my function.

function drawStuff() {
        var data =  google.visualization.arrayToDataTable([
          ['Work', 'workDone',{ role: 'style' }],
          ["kishan", 44,'color:green'],
          ["Yash", 31,'color:green'],
          ["Sanket", 12,'color :red'],
          ["Adil", 48,'color:yellow'],
          ['Other', 450,'color:green']
        ]);

        var options = {
          title: 'Work done in Here',
          width: 450,

          legend: { position: 'none' },
          chart: { subtitle: 'popularity by percentage' },
          axes: {
            x: {
              0: { side: 'top', label: 'White to move'} // Top x-axis.
            }
          },
          bar: { groupWidth: "90%" }
        };

        var chart = new google.charts.Bar(document.getElementById('top_x_div'));
        // Convert the Classic options to Material options.
        chart.draw(data, google.charts.Bar.convertOptions(options));
      };
dlaliberte commented 7 years ago

Sorry, but the material charts (google.charts.Bar in your case) don't support the style role. You'll have to switch back to the classic corecharts to use that feature.

On Thu, Mar 9, 2017 at 5:23 AM, kishanOza notifications@github.com wrote:

i use following function to draw a chart but the 'role:style' not showing any effects. here is my function.

function drawStuff() { var data = google.visualization.arrayToDataTable([ ['Work', 'workDone',{ role: 'style' }], ["kishan", 44,'color:green'], ["Yash", 31,'color:green'], ["Sanket", 12,'color :red'], ["Adil", 48,'color:yellow'], ['Other', 450,'color:green'] ]);

    var options = {
      title: 'Work done in Here',
      width: 450,

      legend: { position: 'none' },
      chart: { subtitle: 'popularity by percentage' },
      axes: {
        x: {
          0: { side: 'top', label: 'White to move'} // Top x-axis.
        }
      },
      bar: { groupWidth: "90%" }
    };

    var chart = new google.charts.Bar(document.getElementById('top_x_div'));
    // Convert the Classic options to Material options.
    chart.draw(data, google.charts.Bar.convertOptions(options));
  };

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/google/google-visualization-issues/issues/2460, or mute the thread https://github.com/notifications/unsubscribe-auth/AAizDYG4OehdLpupDMaPxIlyY9sixd37ks5rj9MZgaJpZM4MX5Sy .

-- Daniel LaLiberte https://plus.google.com/100631381223468223275?prsrc=2 dlaliberte@Google.com dlaliberte@google.com 5CC, Cambridge MA

ikishanoza commented 7 years ago

ok thanks i found another way to do the same :)

jkaufman001 commented 7 years ago

What was the other way?