TOPIC:

Migrating from Classic to New mode basic question on javascript Google Charts 1 week 1 day ago #260300

  • Topic Author
  • shinzan
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 68
  • Thanks: 0
I'm trying to create this google chart exactly as it is on:

developers-dot-devsite-v2-prod.appspot.c...cs/gallery/linechart

If you look at the js fiddle you can see its very basic, it imports a .js then it does some javascript and sets the div = to the results.

I make a basic form and add one section to it and name it "div_chart"

I add the following init script to it:
function ff_Expenses_Station_init()
{

  <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>

<script  type="text/javascript">

google.charts.load('current', {packages: ['corechart', 'line']});
google.charts.setOnLoadCallback(drawLineColors);

function drawLineColors() {
      var data = new google.visualization.DataTable();
      data.addColumn('number', 'X');
      data.addColumn('number', 'Dogs');
      data.addColumn('number', 'Cats');

      data.addRows([
        [0, 0, 0],    [1, 10, 5],   [2, 23, 15],  [3, 17, 9],   [4, 18, 10],  [5, 9, 5],
        [6, 11, 3],   [7, 27, 19],  [8, 33, 25],  [9, 40, 32],  [10, 32, 24], [11, 35, 27],
        [12, 30, 22], [13, 40, 32], [14, 42, 34], [15, 47, 39], [16, 44, 36], [17, 48, 40],
        [18, 52, 44], [19, 54, 46], [20, 42, 34], [21, 55, 47], [22, 56, 48], [23, 57, 49],
        [24, 60, 52], [25, 50, 42], [26, 52, 44], [27, 51, 43], [28, 49, 41], [29, 53, 45],
        [30, 55, 47], [31, 60, 52], [32, 61, 53], [33, 59, 51], [34, 62, 54], [35, 65, 57],
        [36, 62, 54], [37, 58, 50], [38, 55, 47], [39, 61, 53], [40, 64, 56], [41, 65, 57],
        [42, 63, 55], [43, 66, 58], [44, 67, 59], [45, 69, 61], [46, 69, 61], [47, 70, 62],
        [48, 72, 64], [49, 68, 60], [50, 66, 58], [51, 65, 57], [52, 67, 59], [53, 70, 62],
        [54, 71, 63], [55, 72, 64], [56, 73, 65], [57, 75, 67], [58, 70, 62], [59, 68, 60],
        [60, 64, 56], [61, 60, 52], [62, 65, 57], [63, 67, 59], [64, 68, 60], [65, 69, 61],
        [66, 70, 62], [67, 72, 64], [68, 75, 67], [69, 80, 72]
      ]);

      var options = {
        hAxis: {
          title: 'Time'
        },
        vAxis: {
          title: 'Popularity'
        },
        colors: ['#a52714', '#097138']
      };

      var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
      chart.draw(data, options);
    }



</script>

} // ff_Expenses_Station_init

What am i missing?

Please Log in or Create an account to join the conversation.

[Solved] Migration Classic -New mode basic question on javascript Google Charts 1 week 1 day ago #260304

  • Topic Author
  • shinzan
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 68
  • Thanks: 0
Before Form:
echo "<script type='text/javascript' src=' www.gstatic.com/charts/loader.js '>";

then remove all script tags on before form script and paste the .js code in there

done, thanks.

Please Log in or Create an account to join the conversation.

[Solved] Migration Classic -New mode basic question on javascript Google Charts 1 week 11 hours ago #260326

  • Mirec's Avatar
  • Mirec
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 206
  • Karma: 2
  • Thanks: 3
Hi,

I'm glad you solved it and thank you for sharing the solution with the community.
If you need help in the future, feel free to ask! :)

Regards,
Mirko

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.036 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!