Jump to content

Interactive chart in submission form


Recommended Posts

Hello,

I'm a new user in Caspio and I don't know Javascript very good.

I'm working for a client in Real estate and I need to copy a plugin originaly implemented in Wordpress with an interactive doughnut chart related to inserted datas : https://protect-finance.ch/#calculateur

I would like to make a similar application with Caspio.

At this point I have found a code that design the kind of chart I need BUT when we load the page, it generates a popup that asks the parameter values ([@Fonds], [@Prix]...) WHILE I would like that the chart automaticaly changes when we modify the values in the related fields.

I've tried to insert and [@InsertRecordID], GetElementbyName, .onkeyup or ,onchange but nothing seems to work.

Here's the code I have :

<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script><script type="text/javascript">
      google.charts.load("current", {packages:["corechart"]});
      google.charts.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ['Values', 'options'],
          ['Prix',     [@Fonds]],
          ['Revenus',  [@Prix]],
          ['Fonds',  [@Revenus]],
        ]);

        var options = {
          title: 'Capacité Financière',
          pieHole: 0.4,
        };

        var chart = new google.visualization.PieChart(document.getElementById('donutchart'));
        chart.draw(data, options);
      }
    </script>
<div id="donutchart" style="width: 900px; height: 500px;"></div>
 

Could anyone help me please?

Thanks a lot in advance

 

 

 

Link to comment
Share on other sites

  • 3 weeks later...
  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...