"google pie chart"
Bootstrap 4.1.1 Snippet by muhittinbudak

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <div class="container"> <div class="row"> <br /> <div id="piechart" style="width: 100%; height: 100%;"></div> <br /> <br /> <button type="button" class="btn btn-primary btn-lg">Değer değiştir</button> <div id="sonuc">1</div> </div> </div>
$(document).ready(function(){ google.charts.load('current', {'packages':['corechart']}); google.charts.setOnLoadCallback(drawChart); function drawChart(aylik=20, rezerv=80) { var data = google.visualization.arrayToDataTable([ ['Task', 'Hours per Day'], ['Rezerv', rezerv], ['12x Aylık', aylik] ]); var options = { title: 'Rezerv Aylık Grafiği', pieSliceText: 'none', width: 300, height: 300, //pieHole: 0.5, colors: ['#C086A9','#F4DC61'], // rezerv , aylık chartArea:{left: 0,top: 0,width: "100%",height: "100%"}, legend: {position: 'none'}, enableInteractivity: false }; var chart = new google.visualization.PieChart(document.getElementById('piechart')); chart.draw(data, options); } $("button").click(function(){ //--- başlangıç $("#sonuc").html("Changed"); drawChart(30784*12, 2994715); //aylik rezerv }); //------------bitiş //--------------bitiş });

Related: See More


Questions / Comments: