Hi all,
How can we apply color to a bar as red whenever it is high?
Like a bar which has the highest value should be always red, and medium
value should have yellow and at last lowest value as green..
Please suggest a way as soon as possible
--
You received this message because you are
Use a style role column to color your bars:
var data = google.visualization.arrayToDataTable([
['Name', 'Value', {role: 'style', type: 'string'}],
['High', 50, '#d51711'],
['Medium', 25, '#f9f107'],
['Low', 10, '#11d517']
]);
On Friday, June 27, 2014 3:02:01 AM UTC-4, Nagendra
I meant color based on value... I do not need to hard code it.. My values
changes dynamically.
On Fri, Jun 27, 2014 at 10:14 PM, Andrew Gallant asgallant...@gmail.com
wrote:
Use a style role column to color your bars:
var data = google.visualization.arrayToDataTable([
['Name', 'Value',
You can use a DataView to make this dynamic:
// get min/max from column 1
var range = data.getColumnRange(1);
var view = new google.visualization.DataView(data);
view.setColumns([0, 1, {
type: 'string',
role: 'style',
calc: function (dt, row) {
var val = dt.getValue(row, 1);
//THIS IS MY JS PAGE
google.load('visualization', '1.1', {packages:
['corechart','controls','table']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var jsonData = $.ajax({
url: /RestartSpringRestService/rest/allIndicator,
dataType: json,
Ok, that is a bit different from what I thought you were doing. The
ColorFormatter should work for the Table, but it won't do anything for the
ColumnChart.
You can modify the DataView to accommodate your ranges and additional
columns:
var view = new google.visualization.DataView(data);
Sorry, my mistake, I forgot to change the column indices in the cpu and
memory columns:
var view = new google.visualization.DataView(data);
view.setColumns([0, 1, {
type: 'string',
role: 'style',
calc: function (dt, row) {
// buffer colors
var val = dt.getValue(row,
Yup.. I noticed and corrected... By the way, thanks a lot...
On Sat, Jun 28, 2014 at 12:06 AM, Andrew Gallant asgallant...@gmail.com
wrote:
Sorry, my mistake, I forgot to change the column indices in the cpu and
memory columns:
var view = new google.visualization.DataView(data);
Hi Ben,
We're not sure, but there are some indications that China has been blocking
many Google services. Some press reports are connecting this to the
anniversary of Tianamen Square, so it may be a short-lived phenomenon.
If it's not, it's hard for us to give advice on what to do, since we
Thanks Jon!
Am Freitag, 27. Juni 2014 schrieb 'Jon Orwant' via Google Visualization API
:
Hi Ben,
We're not sure, but there are some indications that China has been
blocking many Google services. Some press reports are connecting this to
the anniversary of Tianamen Square, so it may be a
10 matches
Mail list logo