1
Good afternoon, I am providing maintenance on a code that features a graph, the X axis presents the last 11 months and the current month, who wrote it entered the months manually and wanted to automate, I thought to do it as follows:
$meses = array(date(m)-11, date(m)-10, date(m)-9, date(m)-8, date(m)-7, date(m)-6, date(m)-5, date(m)-4, date(m)-3, date(m)-2, date(m)-1, date(m));
the problem is that doing so the months will be shown in number form and I need it to appear in date(M) format, but the function does not accept subtraction 'date(M)-1';
This graph is being generated as ?
– Diego Souza
highcharts.js and jquery.js with / month values added manually.
– Tom Salles
Put the Chart code
– Diego Souza
it is all compacted in a single line and unreadable :(
– Tom Salles
But in some file has the code that mounts the graph.
– Diego Souza
here: $('#container'). highcharts({ Chart: { zoomType: 'xy' }, title: { text: 'Objective chart <?php echo date(’d/m/Y'); ? >' }, Xaxis: [{ Categories: ['Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], crosshair: true }], yAxis: [{ // Primary yAxis }, { // Secondary yAxis Opposite: true }], Legend: { layout: 'vertical', align: 'left', x: 100, verticalAlign: 'top', y: 100, floating: true, backgroundColor: (Highcharts.Theme && Highcharts.theme.legendBackgroundColor) || '#FFFF' },
– Tom Salles
continuation series: [{ name: 'Completed, type: 'column', data: [0, 0, 0, 1, 2, 2, 3, 0], }, { name: 'Goal', type: 'Spline', date: [1, 4, 4, 5, 8, 8, 11, 15, 15], }]
– Tom Salles