jQuery UI Widgets Forums Chart Jqwidget Stacked chart not working for specific data

This topic contains 2 replies, has 2 voices, and was last updated by  Dimitar 9 years, 8 months ago.

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

  • arunthatham
    Participant

    HI ,
    The below is the chart script which i use .On which the chart is not rendering for specific data in x axis like “30/11/2014” and it works if it is “11/30/2014″.I didnt specify any type in chart specification and in Json i am returning as string.

    Script:
    $.x.y.z.RunTimeLoad = function () {
    // prepare chart data as an array

    var source = {
    type: ‘POST’,
    datatype: ‘json’,
    datafields: [{
    name: ‘RunTime’

    }, {
    name: ‘IdleTime’

    }, {
    name: ‘XAxisItem’

    }],
    url: ‘../x/y’, root: ‘Rows’,

    beforeprocessing: function (data) {
    $.x.y.z= data.Rows;
    var seriesGroups = $(‘#runtimeChart’).jqxChart(‘seriesGroups’);
    // change nested setting.
    seriesGroups[0].valueAxis.maxValue =data.maxi;
    seriesGroups[0].valueAxis.minValue = data.mini;
    seriesGroups[0].valueAxis.unitInterval = data.intir;

    }
    };
    var toolTipCustomFormatFn = function (value, itemIndex, serie, group, categoryValue, categoryAxis) {

    return ‘<DIV style=”text-align:left”><b>Time: ‘ +
    ‘</b><br />Run Time: ‘ + $.x.y.z[itemIndex].RunTime +
    ‘</b><br />Idle Time: ‘ + $.x.y.z[itemIndex].IdleTime+
    ‘<br />During: ‘ + $.x.y.z[itemIndex].XAxisItem;
    };
    var dataAdapter = $.unify.asset.chart.dataAdapter = new $.jqx.dataAdapter(source, {
    contentType: “application/json”,
    formatData: function (data) {

    $.extend(data, {
    “ff”: 77,
    “ff”: 5,
    “ff”: 5,
    ff: 6,
    ff: “6”
    });
    return JSON.stringify(data);
    },
    beforeLoadComplete: function (records) {
    //var data = new Array();
    // update the loaded records. Dynamically add EmployeeName and EmployeeID fields.
    //for (var i = 0; i < records.length; i++) {
    // var employee = records[i];
    // employee.EmployeeName = employee.FirstName + ” ” + employee.LastName;
    // employee.EmployeeID = employee.uid;
    // data.push(employee);
    //}
    //return data;
    //var seriesGroups = $(‘#chart-data’).jqxChart(‘seriesGroups’);
    //// change nested setting.
    //seriesGroups[0].valueAxis.maxValue = 100;
    },
    downloadComplete: function (edata, textStatus, jqXHR) {
    //var seriesGroups = $(‘#chart-data’).jqxChart(‘seriesGroups’);
    //// change nested setting.
    //seriesGroups[0].valueAxis.maxValue = 100;
    }
    });

    // prepare jqxChart settings
    var settings = {
    title: “Run”,
    description: “”,
    enableAnimations: true,
    showLegend: true,
    padding: { left: 5, top: 5, right: 5, bottom: 5 },
    titlePadding: { left: 90, top: 0, right: 0, bottom: 10 },
    source: dataAdapter,

    xAxis:
    {
    dataField: ‘XAxisItem’,
    showTickMarks: true,
    tickMarksInterval: 1,
    tickMarksColor: ‘#888888’,
    unitInterval: 1,
    showGridLines: false,
    gridLinesInterval: 1,
    gridLinesColor: ‘#888888’,
    axisSize: ‘auto’

    },
    colorScheme: ‘scheme06’,
    seriesGroups:
    [
    {
    type: ‘stackedcolumn’,
    columnsGapPercent: 12,
    seriesGapPercent: 0,
    toolTipFormatFunction: toolTipCustomFormatFn,
    valueAxis:
    {
    unitInterval: 2,
    minValue: 0,
    maxValue: 24,
    displayValueAxis: true,
    description: ‘Time in Hours’,
    tickMarksColor: ‘#888888’
    },
    series: [
    { dataField: ‘RunTime’, displayText: ‘Run Time’ },
    { dataField: ‘IdleTime’, displayText: ‘ Idle Time’ }
    ]
    }
    ]
    };
    // setup the chart
    $(‘#runtimeChart’).jqxChart(settings);

    }


    arunthatham
    Participant

    Even i tried to specify the type as string it didnt work .
    var source = {
    type: ‘POST’,
    datatype: ‘json’,
    datafields: [{
    name: ‘RunTime’

    }, {
    name: ‘IdleTime’

    }, {
    name: ‘XAxisItem’,
    type: ‘string’

    }],
    url: ‘../x/y’, root: ‘Rows’,

    beforeprocessing: function (data) {

    }
    };

    It is a very critical bug for us .Please help us to proceed further ASAP.


    Dimitar
    Participant

    Hello arunthatham,

    Please share a JSFiddle example demonstrating this issue and we will try to help you fix it.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

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

You must be logged in to reply to this topic.