1

I would to show my line chart into my html page but the filter date is always disabled and i haven't the data in xAxis, i don't know the cause of this kind of the problem ? Any help please ?

my code is :

function buildNumberElem(tabIn) {
        var tabOut = [];
        var data = []; 
        console.log(tabIn);
        for (i in tabIn) {
            var daTmp = tabIn[i].split("/");
            var da = Date.UTC(parseInt(daTmp[2]), parseInt(daTmp[1]), parseInt(daTmp[0]));

            if (tabOut[da]) {
                tabOut[da] = tabOut[da] + 1;
            } else {
                tabOut[da] = +1;
            }
        }
       for(i in tabOut){
            var dataX = [i,tabOut[i]]; 
            data.push(dataX);
        }
        return data;
    }



// lineData
    var lineData = [{
            name: 'RC',
            data: buildNumberElem(rc)
        },{
            name: 'DAB',
            data: buildNumberElem(dab)
        }];
    renderSinistersLineChart('line', lineData);

$('#lineChart').highcharts('StockChart', {
        chart: {
            renderTo: 'container',
            type: 'line'
        },
        scrollbar: {
            enabled: false
        },
        navigator: {
            enabled: true
        },
        rangeSelector : {
            allButtonsEnabled: true,
            buttons: [{
                type: 'month',
                count: 3,
                text: 'Jours',
                dataGrouping: {
                    forced: true,
                    units: [['day', [1]]]
                }
            },{
                type: 'all',
                text: 'Mois',
                dataGrouping: {
                    forced: true,
                    units: [['month', [1]]]
                }
            }],
            buttonTheme: {
                width: 60
            },
            selected: 2
        },
        title: {
            text: 'Déclarations de Sinistres',
            x: -20 //center
        },
        subtitle: {
            text: 'du 01/01/'+ year +' au '+ today,
            x: -20
        },
        tooltip: {
            valueSuffix: ' sinistres', 
        },
        legend: {
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'bottom',
            borderWidth: 0
        },
        // Dynamic DATA  
        series: linedata
        ,
        credits: {
            enabled: false
        },
        exporting: {
            buttons: {
                contextButton: {
                    text: 'Imprimer'
                }
            }, 
            printButton: {
                enabled: true
            }
        }
    });
FG5
  • 53
  • 1
  • 8
  • Please create jsfiddle with code that works. In your example there are multiple issues: 1. `renderSinistersLineChart` is not defined 2. `series: linedata` is not defined, you probably meant `series: lineData` 3. `highcharts('StockChart', {` throws `TypeError: A[a] is not a constructor`, removing `'StockChart',` makes it work. You can edit mine fiddle: http://jsfiddle.net/e3yveLqq/ – Ivan Jovović Aug 18 '15 at 15:28
  • thank you for your response. i create my mine fiddle :http://jsfiddle.net/fmoumni/2x7gkgu9/ , i want to have a operationnel filter date ( Format fr ) and my tooltip should not show the timestamp date . thx :) – FG5 Aug 18 '15 at 16:26
  • By filter date you mean a navigator? How it should be filtered? A few clues, remove categories, and add timestamp in your date point as x. As I see you parse that so push only. – Sebastian Bochan Aug 19 '15 at 12:40
  • thx Sebastien for your advice. i updated my mine fiddle http://jsfiddle.net/2x7gkgu9/7/, so i resolved my problem of date. i nedd now to install datetime picker into filter date so i have now solution in mind ? any help please – FG5 Aug 19 '15 at 14:37
  • Check our demo with datepicker: - http://jsfiddle.net/BWEm5/191/ – Sebastian Bochan Aug 20 '15 at 14:49
  • do u think that i need to < $.getJSON('URL', function (data) { }> ! – FG5 Aug 20 '15 at 15:02
  • how to integrate the datepicker in my fiddle code : http://jsfiddle.net/2x7gkgu9/7/ , without the use of $.getJSON() ! thx – FG5 Aug 20 '15 at 15:04
  • @moumni Code need to run datepicker is not JSON dependent. You code with datepicker: http://jsfiddle.net/2x7gkgu9/10/ – Kacper Madej Aug 21 '15 at 14:50
  • thx u Kacper Madej :-) – FG5 Aug 24 '15 at 13:38
  • i want to show the line chart into lightbox , my problem is to my filter date date is disabled and i can not filter by date ! can i help me ! thanx a lot ! – FG5 Aug 28 '15 at 13:46

0 Answers0