javascript - echo php variable in Highcharts -


how echo php variable script of highchart js? im using column chart

<?php $value=75 ?> 

at series section

series: [{             name: 'traf',             data: [<?php echo $value?>, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]          }] 

any solution helps.

mixing php js bad habit, can either store $value in hidden field:

<input type="hidden" value="<?=$value?>" id="txtchart" name="txtchart" /> 

then in javascript:

var txtchart = $("#txtchart").val(); series: [{         name: 'traf',         data: [txtchart, 71.5, 106.4....]     }] 

Comments

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -