First off, tableColorFormat is deprecated; use ColorFormat instead.
Second, the problem is a CSS issue: by default, links don't inherit the
color of their parent containers, so you have to make them. Add this as a
style to the playground, and the colors will work properly:
#visualization a {
color: inherit;
}
Maybe this is something the Viz team should look into offering an option
for, but for now the CSS should do the trick.
On Thursday, March 29, 2012 9:54:19 PM UTC-4, sanj wrote:
>
> I am facing issues while implementing multiple formaters on the table
> chart in the example
>
> http://code.google.com/apis/ajax/playground/?type=visualization#color_formatter
>
>
> In my sample code listed below, It seems like the "formatter1"
> overrides "formatter"
> as the text color is no longer white or red or even black but its all
> blue because of the hyperlink.
>
> var formatter = new google.visualization.TableColorFormat();
> formatter.addRange(-20000, 0, 'white', 'orange');
> formatter.addRange(20000, null, 'red', '#33ff33');
> formatter.format(data, 1); // Apply formatter to second column
>
> var formatter1 = new google.visualization.PatternFormat('<a
> href="{0}">{1}</a>');
> formatter1.format(data, [0,1],1);
>
> You may copy this code above at line number line#23 of
>
> http://code.google.com/apis/ajax/playground/?type=visualization#color_formatter
>
> and try to run it in playground to see the result that I see.
>
> What do I need to do in order to retain the text color that I want
> from "formatter"
>
>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-visualization-api/-/F1lnm0tiIK8J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.