Done. but there should me some mistakes somewhere. I cannot see anything
now.
Thanks for your help


2014-03-14 22:54 GMT+01:00 asgallant <drew_gall...@abtassoc.com>:

> There are a few problems with your code.  First, you need to draw a chart
> using the DataView instead of the DataTable if you want to see the effects
> of the calculated column.  Second, you create two views based on different
> DataTables, but give them the same variable name, so the second overwrites
> the first.  Give the two views different names:
>
> var viewTot = new google.visualization.DataView(dataTot);
> view.setColumns([0, 1, {
>     calc: "stringify",
>     sourceColumn: 1,
>     type: "string",
>     role: "annotation"
> }, 2]);
>
> var viewDisp = new google.visualization.DataView(dataDisp);
> view.setColumns([0, 1, {
>     type: 'string',
>     role: 'style',
>     calc: function (dt, row) {
>     return (dt.getValue(row, 1) < 0) ? 'red' : 'green';
>     }
> }]);
>
> Then use the views to draw the charts:
>
> chartDisp.draw(viewDisp, optionsDisp);
> chartTot.draw(viewTot, optionsTot);
>
> On Friday, March 14, 2014 4:23:18 PM UTC-4, Floriano Sabatini wrote:
>
>> Ciao Asgallant,
>> why it does,t work here. see the column graph
>> http://solarflor.dyndns.org/123solar/monitor_lite2.html
>>
>> what is wrong.
>> Thanks
>> Floriano
>>
>>
>> 2014-03-14 0:00 GMT+01:00 Floriano Sabatini <sabatini....@gmail.com>:
>>
>>> YES. This is the solution I was looking for.
>>> grazie 1000
>>>
>>> Floriano
>>>
>>>
>>> Il giorno giovedì 13 marzo 2014 22:49:20 UTC+1, asgallant ha scritto:
>>>
>>>> Use a "style" role column to set the color of each bar.  Here's an
>>>> example: http://jsfiddle.net/asgallant/aFs9x/3/
>>>>
>>>>
>>>> On Thursday, March 13, 2014 5:46:00 PM UTC-4, Floriano Sabatini wrote:
>>>>>
>>>>> Dear all,
>>>>> I would like to use the column chart gouge with just one column that
>>>>> will represent the difference between Produced and Consumed energy. To be
>>>>> effective I need to have the colour of the column that change from green
>>>>> (if the value is positive) to red if it is negative.
>>>>>
>>>>> Is this something feasible?
>>>>> Many thanks
>>>>> Floriano
>>>>>
>>>>  --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "Google Visualization API" group.
>>> To unsubscribe from this topic, visit https://groups.google.com/d/
>>> topic/google-visualization-api/Zd9B1gKrE2w/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> google-visualization-api+unsubscr...@googlegroups.com.
>>> To post to this group, send email to google-visua...@googlegroups.com.
>>>
>>> Visit this group at http://groups.google.com/
>>> group/google-visualization-api.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Google Visualization API" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/google-visualization-api/Zd9B1gKrE2w/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> google-visualization-api+unsubscr...@googlegroups.com.
> To post to this group, send email to
> google-visualization-api@googlegroups.com.
> Visit this group at
> http://groups.google.com/group/google-visualization-api.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
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