title: amchart - pass parameters to properties/reuse properties across graphs/Use same property across multiple graphs
body: <p>Here's the code I use to plot a line graph.</p>
  
  <pre><code>var db_query = &lt;?php echo json_encode($db_query_1) ?&gt;;
  var chart;
  var graph;
  
  /* chart initialization */
  var chart = AmCharts.makeChart("plot1", {
      type: "serial",
      categoryField: "OCCUR_DATE",
      graphs: [{
          type: "smoothedLine",
          theme: "light",
          valueField: "FREQ"
      }]
  })
  
  $.ajax({
      type: 'POST',       
      url: "mySQL.php",
      data: {'db_que': db_query},
      dataType: 'html',
      context: document.body,
      global: false,
      async:true,
      success: function(data) {
          //alert(data);
          chart.dataProvider = eval(data);
          chart.validateNow();
      }
  });
  </code></pre>
  
  <p>I'd like to</p>
  
  <ol>
  <li>Create a separate javascript file with properties defined for each of line, pie, bar etc types of graphs &amp; import that javascript file</li>
  <li><p>replace this: </p>
  
  <pre><code>var chart = AmCharts.makeChart("plot1", {
      type: "serial",
      categoryField: "OCCUR_DATE",
      graphs: [{
          type: "smoothedLine",
          theme: "light",
          valueField: "FREQ"
      }]
  })
  </code></pre>
  
  <p>with</p>
  
  <pre><code>var chart = AmCharts.makeChart("plot1", options_line_graph);
  </code></pre></li>
  <li><p>I'd like to be able to pass parameters to the properties for the
  x-axis &amp; y-axis titles &amp; the graph name. These are at least the very
  few variable parameters I can think of now. If I can achieve this,
  adding more variable parameters could be done easily I presume.</p></li>
  </ol>
  
  <p>The reason I ask for help here is, I have over 30 line graphs, 20 pie charts &amp; a few of other types that I will plot. Setting the same set of properties over &amp; over again sounds an inefficient way of doing things.</p>
  
  <p>Could someone please guide/help me?</p>