TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Phanindra Pothuri
NA
1
940
barchart percentage for single value
Feb 2 2015 12:27 AM
how to set percentage in bar chart. My code like this
google.load("visualization", "1", { packages: ["corechart"] });
google.setOnLoadCallback(drawChart);
function drawChart()
{
var data = new google.visualization.DataTable();
data.addColumn('string', 'default');
data.addColumn('number', 'Count');
data.addColumn({type: 'string', role: 'style'});
var localService = @Html.Raw(Json.Encode(@ViewBag.localList));
for(var i = 0; i < localService.length; i ++ )
{
data.addRow(["ResponseTime",localService[i].ResponseTime, 'color: purple']);
data.addRow(["TravelTime",localService[i].TravelTime, 'color: purple']);
data.addRow(["ServiceTime",localService[i].ServiceTime, 'color: purple']);
}
var options = {
hAxis: {title: 'Record Count'},
bar: {groupWidth: "95%"},
legend: { position: "none" },
isStacked: true
};
var chart = new google.visualization.BarChart(document.getElementById('barChart1_div'));
chart.draw(data, options);
}
in the abouve code values coming from dynamically . How i set each bar as percentage
Reply
Answers (
0
)
how to add dynamic rules based on user input to webconfig ?
css menu problem, automatically adding text when publish