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

sql - VB.NET Operand type clash: date is incompatible with int error -

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

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -