Jiju John
Jiju John

Reputation: 821

auto width in google visualization

I have used below code to show scroll bar in google visualization when the char is large,

stringBuilder.Append(" var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));");
                    stringBuilder.Append(" chart.draw(view, {width: 660, height: 500, title: 'Title',");
                    stringBuilder.Append("legend: {position: 'none'},");
                    stringBuilder.Append("hAxis: {title: 'Resource', titleTextStyle: {color: 'green'},slantedText:false},width:'data.getNumberOfRows() * 130',colors: ['DeepSkyBlue','green'],");

                    stringBuilder.Append("vAxis:{title: 'Effort (Hr)',titleTextStyle: {color: 'green'}}");

when using width:'data.getNumberOfRows() * 130' it is not working, when set width a number it works, how do I set this?

Upvotes: 0

Views: 40

Answers (1)

WhiteHat
WhiteHat

Reputation: 61212

you're passing a "string", instead of a "calculation"

remove the apostrophe's...

width: data.getNumberOfRows() * 130

Upvotes: 2

Related Questions