You can use different series to associate with different colors (which means instead of your status column, you would put the duration value in one of two columns, one for failed and one for correct).
Or you can replace your status column with a 'style' role column that you put after your duration column. This will let you specify the color of each bar. See https://developers.google.com/chart/interactive/docs/roles On Wed, Feb 15, 2017 at 4:16 AM, Ignacio CastaƱeira < [email protected]> wrote: > Hi, all! > > My intention is to draw a bar chart that will show information about a > program execution. > > The bar height itself will show the execution duration in seconds (vAxis), > but I'd like the bar color to show the executions status (eg. red for > failed execution, blue for correct execution) > > var data = new google.visualization.arrayToDataTable([ > ["Date", "Status", "Duration (s)"], > ["13/02/2017 13:42:58", 0, 29], > ["13/02/2017 16:53:07", 1, 41], > ["13/02/2017 16:54:36", 0, 26] > ]); > > Status 0 is correct, 1 is failed execution. > > I've been checking the forum but I couldn't find any meaningful info. Is > there a way to do what I want? Perhaps an if/else block in the "colors" > array from options?? > > Thanks in advance for your answers! Best regards! > > -- > 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 [email protected]. > 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/813f1a4c-4b00-4063-956f- > 480647f10234%40googlegroups.com > <https://groups.google.com/d/msgid/google-visualization-api/813f1a4c-4b00-4063-956f-480647f10234%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> [email protected] <[email protected]> 5CC, Cambridge MA -- 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 [email protected]. To post to this group, send email to [email protected]. 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/CAOtcSJNffDnGfF-tyxeYcQX5g5MA34N89fzDyrgfWD9vkziwwg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
