jQuery UI Widgets Forums Chart infinite loop when load page

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • infinite loop when load page #20101

    aecosis
    Member

    data.php – get contain like this
    [{“Date”:”2013-03-25″,”Product_name”:”web”,”Total_sales”:”10000″},{“Date”:”2013-04-17″,”Product_name”:”ikan”,”Total_sales”:”10000″}]

    when load the script, its only loading like infinite loop.

    this is the script code

    <html>
    <head>
    <link rel="stylesheet" href="css/jqx.base.css" type="text/css" />
    <script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="js/jqxcore.js"></script>
    <script type="text/javascript" src="js/jqxchart.js"></script>
    <script type="text/javascript" src="js/jqxdata.js"></script>
    <script type="text/javascript">
    $(document).ready(function () {
    var source =
    {
    datatype: "json",
    datafields: [
    { name: 'Date', type: 'date'},
    { name: 'Total_sales'},
    { name: 'Product_name'}
    ],
    url: 'data.php'
    };
    var dataAdapter = new $.jqx.dataAdapter(source,
    {
    autoBind: true,
    async: false,
    downloadComplete: function () { },
    loadComplete: function () { },
    loadError: function () { }
    });
    // prepare jqxChart settings
    var settings = {
    title: "Orders by Date",
    showLegend: true,
    padding: { left: 5, top: 5, right: 5, bottom: 5 },
    titlePadding: { left: 90, top: 0, right: 0, bottom: 10 },
    source: dataAdapter,
    categoryAxis:
    {
    text: 'Category Axis',
    textRotationAngle: 0,
    dataField: 'Date',
    formatFunction: function (value) {
    return $.jqx.dataFormat.formatdate(value, 'dd/MM/yyyy');
    },
    showTickMarks: true,
    tickMarksInterval: Math.round(dataAdapter.records.length / 6),
    tickMarksColor: '#888888',
    unitInterval: Math.round(dataAdapter.records.length / 6),
    showGridLines: true,
    gridLinesInterval: Math.round(dataAdapter.records.length / 3),
    gridLinesColor: '#888888',
    axisSize: 'auto'
    },
    colorScheme: 'scheme05',
    seriesGroups:
    [
    {
    type: 'line',
    valueAxis:
    {
    displayValueAxis: true,
    description: 'Total All',
    //descriptionClass: 'css-class-name',
    axisSize: 'auto',
    tickMarksColor: '#888888',
    unitInterval: 20,
    minValue: 0,
    maxValue: 100
    },
    series: [
    { dataField: 'Total_sales', displayText: 'Total All' }
    ]
    }
    ]
    };
    // setup the chart
    $('#jqxChart').jqxChart(settings);
    });
    </script>
    </head>
    <body>
    <div id="jqxChart" style="width: 580px; height: 400px;"></div>
    </body>
    </html>
    infinite loop when load page #20115

    Peter Stoev
    Keymaster

    Hi,

    The problem in the provided code is that “unitInterval” is equal to 0. Please, set it to 1 at least.

    Best Regards,
    Peter Stoev

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

    infinite loop when load page #20116

    aecosis
    Member

    Hi,

    code “unitInterval” that i search equal to 20.. in this code

    valueAxis:
    {
    displayValueAxis: true,
    description: 'Total All',
    //descriptionClass: 'css-class-name',
    axisSize: 'auto',
    tickMarksColor: '#888888',
    unitInterval: 20,
    minValue: 0,
    ma

    xValue: 100
    },

    infinite loop when load page #20121

    Peter Stoev
    Keymaster

    Hi aecosis,

    In the categoryAxis definition, the unitInterval is 0.

    Best Regards,
    Peter Stoev

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

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

You must be logged in to reply to this topic.