How to change color based on the value in the row in google chart for stacked area.

812 views
Skip to first unread message

sachin pawar

unread,
Apr 25, 2017, 6:47:51 PM4/25/17
to Google Visualization API
Hello folks,
i just went through below link and came to know of google charts.

https://carlos-sierra.net/2014/07/28/free-script-to-generate-a-line-chart-on-html/

i have below question.

i have one question.
Lets say i have below kind of data ( the data is present in the attached excel file ash_eg.xlsx).

TIME – containing the sample time from ash truncated to MM/DD/YYYY-HH24:MI
W – containing the wait event, if none, then CPU.
SMPL – count of samples for that event in that “TIME” minute


TIME W SMPL
4/13/2017-19:44 CPU 1
4/13/2017-19:46 log file sync 1
4/13/2017-19:46 CPU 1
4/13/2017-19:46 CPU 1
4/13/2017-19:47 db file sequential read 1
4/13/2017-19:47 db file sequential read 1
4/13/2017-19:47 log file sync 1
4/13/2017-19:47 CPU 1
4/13/2017-19:47 CPU 1
4/13/2017-19:48 CPU 1
4/13/2017-19:49 CPU 1
4/13/2017-19:50 db file sequential read 1
4/13/2017-19:50 flashback log file sync 1
4/13/2017-19:50 log file sync 4
4/13/2017-19:50 control file sequential read 1
4/13/2017-19:50 log file parallel write 1
4/13/2017-19:50 flashback log file write 1
4/13/2017-19:51 db file sequential read 1
4/13/2017-19:52 CPU 1
4/13/2017-19:52 null event 1



i want to make a stacked area chart using google charts only.Like the one given below


As you can see each wait event is shown with different color, but all those wait events are in a single column i.e. W


My requirement is :
w should be a variable where the value of the event will result in a different color.
I dont want to make a different column for each wait separately.
How can i achieve that?

I am looking for a kind of graph ( unfortunately there is not image copy paste option to show exactly) which i can get if i copy the above data in an excel and make a pivot chart:
AXIS(categories)-TIME
LEGEND(series)-W
VALUES-Sum of SMPL

Regds


Sachin

ash_eg.xlsx

Daniel LaLiberte

unread,
Apr 25, 2017, 8:28:51 PM4/25/17
to Google Visualization API
If you want your events to show up in the legend, currently you will have to create a separate column for each.

We are thinking of adding a 'series' role to do something close to what you want, but not today.

--
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+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/057b32e9-a23b-4ea0-8991-2e08fde40a99%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages