jQWidgets Forums

jQuery UI Widgets Forums Chart Erreur in Zooming with baseUnit different

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by  Bocho 11 years, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • Bocho
    Participant

    Hi,

    I am to create the zooming with baseunit hour for chart and baseunit day for rangeSelector.

    My chart is good but when I select a interval less than one day, my chart is empty.
    If I change rangeSelector’s baseunit to hour, I don’t have the error but label is in hour.

    
                var source =
                {
                    datatype: "json",
                    datafields: [
                        { name: 'datetime', type: 'data' },
                        { name: 'temp', type: 'int' },
                        { name: 'hum', type: 'int' }
                        ],
                    url: 'XXXXXXXX'
                };
                var dataAdapter = new $.jqx.dataAdapter(source, { async: false, autoBind: true, loadError: function (xhr, status, error) { alert('Error loading "' + source.url + '" : ' + error); } });
    			
    			
               var months = ['Jan', 'Fev', 'Mar', 'Avr', 'Mai', 'Jun', 'Jul', 'Aou', 'Sep', 'Oct', 'Nov', 'Dec'];
    			
                // prepare jqxChart settings
                var settings = {
                    title: "",
                    description: "",
                    enableAnimations: true,
                    animationDuration: 1500,
                    enableCrosshairs: true,
                    padding: { left: 5, top: 20, right: 30, bottom: 5 },
                    source: dataAdapter,
                    categoryAxis:
                        {
                            dataField: 'datetime',
                            formatFunction: function (value) {
    			    if(value.getMinutes < 10)
                                     return value.getDate() + ' - ' + months[value.getMonth()] +'<br>'+ value.getHours() + ':0'+value.getMinutes();
    			    else
                                      return value.getDate() + ' - ' + months[value.getMonth()] +'<br>'+ value.getHours() + ':'+value.getMinutes();
    
    		         },
                            type: 'date',
                            baseUnit: 'hour',
                            rangeSelector: {
                                size: 60,
                                padding: { top: 10, bottom: 0 },
                                dataField: 'temp',
                                baseUnit: 'day',
                             }
                        },
                    colorScheme: 'scheme01',
                    seriesGroups:
                        [
                            {
                                type: 'line',
                                valueAxis:
                                {
                                    description: 'temperature<br><br>',
    				axisSize: 'auto',
                                },
                                series: [
                                    { dataField: 'temp', displayText: 'temperature', lineWidth: 1, lineWidthSelected: 1 },
                                ]
                            },
                            {
                                type: 'line',
                                valueAxis:
                                {
                                    description: 'Humidité',
                                    minValue: 0,
                                    maxValue: 100,
    				position : 'right'
                                },
                                series: [
                                    { dataField: 'hum', displayText: 'humidité', lineWidth: 1, lineWidthSelected: 1 }
    
                                ]
                            }
    
                        ]
                };
                $('.PlanteChartContainer').jqxChart(settings);
    

    Peter Stoev
    Keymaster

    Hi Bocho,

    { name: ‘datetime’, type: ‘data’ }, – this is invalid. There’s no such type. May be it should be “date” instead of “data”. In case you’d like someone to help you out, please prepare and share a full sample(preferably in http://jsfiddle.net/).

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    Bocho
    Participant

    Hi,

    type data is a typing error but I replace data by date and I have always error.

    I prepare a Jsfiddle : http://jsfiddle.net/Bocho/499Ta/

    Thanks for your help

    Bocho

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.