>
> Hey Sergey, thank you for the answer. Yes it's possible to do it with 
>> inline JS, but our project is already configured with the GWT bindings. One 
>> more question: in the classic column/bar charts is it possible somehow 
>> (even in a hacky way) to put gradient fills on the bars? I tried defining 
>> the gradient in the defs of the svg element and then replacing the fill for 
>> each bar with url(#gradient_id_def) by using GWT DOM elements, but the bar 
>> just becomes blank (ignoring the fill).
>
>
private void hackChart() {
Element defs = DOM.getElementById("defs");
Element linearGradient = DOM.createElement("linearGradient");
linearGradient.setId("grad1");
linearGradient.setAttribute("x1", "0%");
linearGradient.setAttribute("x2", "0%");
linearGradient.setAttribute("y1", "0%");
linearGradient.setAttribute("y2", "100%");
Element stop1 = DOM.createElement("stop");
stop1.setAttribute("offset", "0%");
stop1.setAttribute("style", "stop-color:rgb(255,255,0);stop-opacity:1");
Element stop2 = DOM.createElement("stop");
stop2.setAttribute("offset", "100%");
stop2.setAttribute("style", "stop-color:rgb(255,0,0);stop-opacity:1");
defs.appendChild(linearGradient);
linearGradient.appendChild(stop1);
linearGradient.appendChild(stop2);
Element svgElement = 
barGraph.getElement().getFirstChildElement().getFirstChildElement().getFirstChildElement();
Element barElement = 
svgElement.getChild(2).getChild(1).getChild(1).getChild(1).getParentElement().getFirstChildElement();
barElement.setAttribute("fill", "url(#grad1)");.

 

-- 
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 http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Reply via email to