Complete range is not showing on x-axis of my google chart

13 views
Skip to first unread message

Rahul Tandekar

unread,
May 27, 2020, 3:37:47 AM5/27/20
to Google Visualization API
hi there I have created google chart and it is working nice 
but on the x-axis of the chart, i want to show data below each bar

graph.PNG

     <apex:includeScript id="a" value="https://www.google.com/jsapi" />
        <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
        <script type="text/javascript">
            google.charts.load('current', {'packages':['bar']});
        google.charts.setOnLoadCallback(drawChart);        
        //Strike chart
        function drawChart() {
            var data = google.visualization.arrayToDataTable({! dataList});
            console.log("{!rangeList}",{!rangeList});
            var options = {
                chart: {
                    title: 'Strike Price',
                    subtitle: 'Graph to show Strike Price Rates',
                },
                bars: 'vertical',
                bar: { groupWidth: "25%" },
                hAxis: {
                    viewWindow: {min: 0},
                    hAxis: { ticks: [0,500,520,550,580] }
                },
                
                vAxis: {
                    viewWindow: {min: 0},
                    ticks: {!rangeListY}
                },
                vAxis: {format: 'decimal'},
                hAxis: {format: 'decimal'},
                height: 700,
                colors: ['#1aa110', '#f0250e',]
                         };
                         
                         var chart = new google.charts.Bar(document.getElementById('chart_div'));
                         chart.draw(data, google.charts.Bar.convertOptions(options));
                         }
                         
        </script>



what is the issue here i can't figure out 
can you please help e with that
Thank you
Reply all
Reply to author
Forward
0 new messages