javascript - High Chart X Axis to display month and year -
javascript - High Chart X Axis to display month and year -
in high chart coding, want alter x axis display month , year.(ex- feb-20014) here code work. how can it? want go @ to the lowest degree 5 years. chart column chart. please note that
<script type="text/javascript"> $(function () { // set chart var chart = new highcharts.chart({ chart: { renderto: 'container', type: 'column', margin: 75, options3d: { enabled: false, alpha: 15, beta: 15, depth: 50, viewdistance: 25 } }, title: { text: 'payment details' }, plotoptions: { column: { depth: 25 } }, series: [{ data: [ <?php ($i = 0; $i <= 12; $i++) { echo $i. ','; } ?> ] }] }); function showvalues() { $('#r0-value').html(chart.options.chart.options3d.alpha); $('#r1-value').html(chart.options.chart.options3d.beta); } // activate sliders $('#r0').on('change', function () { chart.options.chart.options3d.alpha = this.value; showvalues(); chart.redraw(false); }); $('#r1').on('change', function () { chart.options.chart.options3d.beta = this.value; showvalues(); chart.redraw(false); }); showvalues(); }); </script>
try :
xaxis: { type: 'datetime', labels: { formatter: function() { homecoming highcharts.dateformat('%b-%y', this.value); } } },
from docs:
%b - abbreviated month name, based on locale(jan through dec) %y - 4 digit representation year(example: 2038)
javascript highcharts
Comments
Post a Comment