jQWidgets Forums

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts

  • Marachl
    Member

    one more thing:

    The reason I can not use hour chart “Custom x-Axis Range” is that I have not hour periods, but I need time period, points have to be on axis exactly at the desired location


    Marachl
    Member

    I have similar problem as yfands.

    I tried several of your examples with categoryAxis from json source in 2013-09-24 00:18:32 format

    and with

    type: ‘date’,
    baseUnit: ‘hour’,

    not work.

    whole code:

    $(document).ready(function () {

    $(‘#jqxChart’).jqxChart({borderLineColor: ‘white’});
    // prepare the data
    var cardid = $(‘.jqxChart_panel’).find(‘input[name=cardid]’).val();
    var dateex = $(‘.jqxChart_panel’).find(‘input[name=dateex]’).val();
    var date_from = $(‘.jqxChart_panel’).find(‘input[name=date_from]’).val();
    var date_to = $(‘.jqxChart_panel’).find(‘input[name=date_to]’).val();
    var source =
    {
    datatype: \”json\”,
    datafields: [
    { name: ‘Date’, type: ‘date’ },
    { name: ‘Altitude’ }

    ],
    url: \”/chart.php?card_id=\” + cardid + \”&date=\” + dateex + \”&date_from=\” + date_from + \”&date_to=\” + date_to + \”\”
    };
    var dataAdapter = new $.jqx.dataAdapter(source);
    // prepare jqxChart settings
    var settings = {
    title: \””.$title.”\”,
    description: \”\”,
    showLegend: true,
    source: dataAdapter,
    categoryAxis: {
    dataField: ‘Date’,
    formatFunction: function (value) {
    return value.getHours() + ‘h’;
    },
    toolTipFormatFunction: function (value) {
    return value.getDate()+ ‘. ‘ + months[value.getMonth()] + ‘ ‘ + value.getFullYear() + ‘ “.translator::find_word(“in”).” ‘ + value.getHours() + ‘ “.translator::find_word(“hours”).” ‘ + value.getMinutes() + ‘ “.translator::find_word(“minutes”).”‘;
    },
    showGridLines: true
    },
    colorScheme: ‘scheme05’,
    seriesGroups: [{
    type: ‘area’,
    valueAxis: {
    displayValueAxis: true,
    minValue: 0,
    axisSize: ‘auto’,
    tickMarksColor: ‘#888888’
    },
    series: [{ dataField: ‘Altitude’, displayText: ‘”.translator::find_word(“altitude”).”‘ }]
    }]
    };
    // setup the chart
    $(‘#jqxChart’).jqxChart(settings);
    // refresh the data when the button is clicked.
    $(‘.jqxChart_panel’).find(‘input[name=refresh]’).click(function () {
    var cardidd = $(‘.jqxChart_panel’).find(‘input[name=cardid]’).val();
    var dateexd = $(‘.jqxChart_panel’).find(‘input[name=dateex]’).val();
    var date_fromd = $(‘.jqxChart_panel’).find(‘input[name=date_from]’).val();
    var date_tod = $(‘.jqxChart_panel’).find(‘input[name=date_to]’).val();
    source.url = \”/chart.php?card_id=\” + cardidd + \”&date=\” + dateexd + \”&date_from=\” + date_fromd + \”&date_to=\” + date_tod + \”\”;
    var dataAdapter = new $.jqx.dataAdapter(source);
    $(‘#jqxChart’).jqxChart({ source: dataAdapter });
    });
    });

    Please help

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