Dear team,
i am using google.visualization.ColumnChart
using following code
<script type="text/javascript"> google.load( "visualization", "1", {packages:["corechart"]}); google.setOnLoadCallback(drawChart); function drawChart() { var data = new google.visualization.DataTable(); data.addColumn('string', 'Key Person'); data.addColumn('number', 'Target'); data.addColumn('number', 'Reached'); data.addColumn('number', 'Up to Date Target'); data.addColumn({type: 'string',role: 'style'}); data.addRows(5);data.setValue( 0,0,'Aravinth','#A0A0A0');data.setValue(0,1,2370,'#A0A0A0') ;data.setValue(0,2,891,'#A0A0A0') ;data.setValue(0,3,1027,'#A0A0A0') ;data.setValue( 1,0,'Chikku','#A0A0A0');data.setValue(1,1,1300,'#A0A0A0') ;data.setValue(1,2,536,'#A0A0A0') ;data.setValue(1,3,545.161290322581,'#A0A0A0') ;data.setValue( 2,0,'Palani','#A0A0A0');data.setValue(2,1,1500,'#A0A0A0') ;data.setValue(2,2,567,'#A0A0A0') ;data.setValue(2,3,629.032258064516,'#A0A0A0') ;data.setValue( 3,0,'Sikander','#A0A0A0');data.setValue(3,1,150,'#A0A0A0') ;data.setValue(3,2,19,'#A0A0A0') ;data.setValue(3,3,62.9032258064516,'#A0A0A0') ;data.setValue( 4,0,'Venkat','#A0A0A0');data.setValue(4,1,2200,'#A0A0A0') ;data.setValue(4,2,766,'#A0A0A0') ;data.setValue(4,3,922.58064516129,'#A0A0A0') ; var chart = new google.visualization.ColumnChart(document.getElementById('chart_div')); chart.draw(data, {width: 1050, height: 750, title: 'Company Performance',hAxis: {title: 'Key Person', titleTextStyle: {color: 'green'}}}); }</script>
i have a request now that
if Reached(i)> dayTarget(i) then that bar must be green color
else red color.
kindly help me.