jQuery UI Widgets Forums Chart Graph problem with a line full of zero

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

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • Graph problem with a line full of zero #8414

    jros
    Member

    When all the data of a line is zero the line is not shown in the graph.

    Graph problem with a line full of zero #8421

    Dimitar
    Participant

    Hello jros,

    The following example shows a chart with one of its lines always at 0. The line displays properly.

    <html lang="en">
    <head>
    <title id='Description'>jQuery Chart Column Series Example</title>
    <link rel="stylesheet" href="../../jqwidgets2.4.2/jqwidgets/styles/jqx.base.css"
    type="text/css" />
    <script type="text/javascript" src="../../scripts/jquery-1.8.1.min.js"></script>
    <script type="text/javascript" src="../../jqwidgets2.4.2/jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="../../jqwidgets2.4.2/jqwidgets/jqxchart.js"></script>
    <script type="text/javascript" src="../../jqwidgets2.4.2/jqwidgets/jqxdata.js"></script>
    <script type="text/javascript">
    $(document).ready(function () {
    // prepare chart data
    var sampleData = [
    { Day: 'Monday', Keith: 0, Erica: 15, George: 25 },
    { Day: 'Tuesday', Keith: 0, Erica: 25, George: 30 },
    { Day: 'Wednesday', Keith: 0, Erica: 20, George: 25 },
    { Day: 'Thursday', Keith: 0, Erica: 25, George: 45 },
    { Day: 'Friday', Keith: 0, Erica: 20, George: 25 },
    { Day: 'Saturday', Keith: 0, Erica: 20, George: 30 },
    { Day: 'Sunday', Keith: 0, Erica: 45, George: 90 }
    ];
    // prepare jqxChart settings
    var settings = {
    title: "Fitness & exercise weekly scorecard",
    description: "Time spent in vigorous exercise",
    padding: { left: 5, top: 5, right: 5, bottom: 5 },
    titlePadding: { left: 90, top: 0, right: 0, bottom: 10 },
    source: sampleData,
    categoryAxis:
    {
    dataField: 'Day',
    showGridLines: false
    },
    colorScheme: 'scheme01',
    seriesGroups:
    [
    {
    type: 'line',
    columnsGapPercent: 30,
    seriesGapPercent: 0,
    valueAxis:
    {
    minValue: 0,
    maxValue: 100,
    unitInterval: 10,
    description: 'Time in minutes'
    },
    series: [
    { dataField: 'Keith', displayText: 'Keith' },
    { dataField: 'Erica', displayText: 'Erica' },
    { dataField: 'George', displayText: 'George' }
    ]
    }
    ]
    };
    // select the chartContainer DIV element and render the chart.
    $('#chartContainer').jqxChart(settings);
    });
    </script>
    </head>
    <body style="background: white;">
    <div id='chartContainer' style="width: 600px; height: 400px" />
    </body>
    </html>

    Best Regards,
    Dimitar

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

    Graph problem with a line full of zero #8425

    jros
    Member

    Yes, this example works, but when I load my data javascript shows:

    Error: Problem parsing d=”M 89,NaN L 89,NaN 89,NaN 90.5,NaN 93.5,NaN 96.5,NaN 99.5,NaN 103.5,NaN 106.5,NaN 109.5,NaN 112.5,NaN 116.5,NaN 119.5,NaN 122.5,NaN 125.5,NaN 128.5,NaN 132.5,NaN 135.5,NaN 138.5,NaN 141.5,NaN 145.5,NaN 148.5,NaN 151.5,NaN 154.5,NaN 158.5,NaN 161.5,NaN 164.5,NaN 167.5,NaN 170.5,NaN 174.5,NaN 177.5,NaN 180.5,NaN 183.5,NaN 187.5,NaN 190.5,NaN 193.5,NaN 196.5,NaN 199.5,NaN 203.5,NaN 206.5,NaN 209.5,NaN 212.5,NaN 216.5,NaN 219.5,NaN 222.5,NaN 225.5,NaN 229.5,NaN 232.5,NaN 235.5,NaN 238.5,NaN 241.5,NaN 245.5,NaN 248.5,NaN 251.5,NaN 254.5,NaN 258.5,NaN 261.5,NaN 264.5,NaN 267.5,NaN 270.5,NaN 274.5,NaN 277.5,NaN 280.5,NaN 283.5,NaN 287.5,NaN 290.5,NaN 293.5,NaN 296.5,NaN 300.5,NaN 303.5,NaN 306.5,NaN 309.5,NaN 312.5,NaN 316.5,NaN 319.5,NaN 322.5,NaN 325.5,NaN 329.5,NaN 332.5,NaN 335.5,NaN 338.5,NaN 341.5,NaN 345.5,NaN 348.5,NaN 351.5,NaN 354.5,NaN 358.5,NaN 361.5,NaN 364.5,NaN 367.5,NaN 371.5,NaN 374.5,NaN 378.5,NaN 380.5,NaN 383.5,NaN 387.5,NaN 390.5,NaN 393.5,NaN 396.5,NaN 400.5,NaN 403.5,NaN 406.5,NaN 409.5,NaN 413.5,NaN 416.5,NaN 419.5,NaN 422.5,NaN 425.5,NaN 429.5,NaN 432.5,NaN 435.5,NaN 438.5,NaN 442.5,NaN 445.5,NaN 448.5,NaN 451.5,NaN 454.5,NaN 458.5,NaN 461.5,NaN 464.5,NaN 467.5,NaN 471.5,NaN 474.5,NaN 477.5,NaN 480.5,NaN 484.5,NaN 487.5,NaN 490.5,NaN 493.5,NaN 496.5,NaN 500.5,NaN 503.5,NaN 506.5,NaN 509.5,NaN 513.5,NaN 516.5,NaN 519.5,NaN 522.5,NaN 525.5,NaN 529.5,NaN 532.5,NaN 535.5,NaN 538.5,NaN 542.5,NaN 545.5,NaN 548.5,NaN 551.5,NaN 555.5,NaN 558.5,NaN 561.5,NaN 564.5,NaN 567.5,NaN 571.5,NaN 574.5,NaN 577.5,NaN 580.5,NaN 584.5,NaN 587.5,NaN 590.5,NaN 593.5,NaN 596.5,NaN 600.5,NaN 603.5,NaN 606.5,NaN 609.5,NaN 613.5,NaN 616.5,NaN 619.5,NaN 622.5,NaN 626.5,NaN 629.5,NaN 632.5,NaN 635.5,NaN 638.5,NaN 642.5,NaN 645.5,NaN 648.5,NaN 651.5,NaN 655.5,NaN 658.5,NaN 661.5,NaN 664.5,NaN”

    My data is:

    09/25/2012 11:25:00,1.99,0,0,0,0
    09/25/2012 11:25:20,1.99,0,0,0,0
    09/25/2012 11:25:40,1.99,0,0,0,0
    09/25/2012 11:26:00,1.99,0,0,0,0
    09/25/2012 11:26:20,1.99,0,0,0,0
    09/25/2012 11:26:40,1.99,0,0,0,0
    09/25/2012 11:27:00,1.99,0,0,0,0
    09/25/2012 11:27:20,1.99,0,0,0,0
    09/25/2012 11:27:40,1.99,0,0,0,0
    09/25/2012 11:28:00,1.99,0,0,0,0
    09/25/2012 11:28:20,2.99,0,0,0,0
    09/25/2012 11:28:40,2.99,0,0,0,0
    09/25/2012 11:29:00,2.99,0,0,0,0
    09/25/2012 11:29:20,1.99,0,0,0,0
    09/25/2012 11:29:40,1.99,0,0,0,0
    09/25/2012 11:30:00,1.99,0,0,0,0
    09/25/2012 11:30:20,2.99,0,0,0,0
    09/25/2012 11:30:40,2.99,0,0,0,0
    09/25/2012 11:31:00,2.99,0,0,0,0
    09/25/2012 11:31:20,2.99,0,0,0,0
    09/25/2012 11:31:40,2.99,0,0,0,0
    09/25/2012 11:32:00,2.99,0,0,0,0
    09/25/2012 11:32:20,0.99,0,0,0,0
    09/25/2012 11:32:40,0.99,0,0,0,0
    09/25/2012 11:33:00,0.99,0,0,0,0
    09/25/2012 11:33:20,1.99,0,0,0,0
    09/25/2012 11:33:40,1.99,0,0,0,0
    09/25/2012 11:34:00,2.99,0,0,0,0
    09/25/2012 11:34:20,2.99,0,0,0,0
    09/25/2012 11:34:40,2.99,0,0,0,0
    09/25/2012 11:35:00,0.99,0,0,0,0
    09/25/2012 11:35:20,0.99,0,0,0,0
    09/25/2012 11:35:40,0.99,0,0,0,0
    09/25/2012 11:36:00,0.99,0,0,0,0
    09/25/2012 11:36:20,0.99,0,0,0,0
    09/25/2012 11:36:40,0.99,0,0,0,0
    09/25/2012 11:37:00,0.99,0,0,0,0
    09/25/2012 11:37:20,1.99,0,0,0,0
    09/25/2012 11:37:40,1.99,0,0,0,0
    09/25/2012 11:38:00,1.99,0,0,0,0
    09/25/2012 11:38:20,1.99,0,0,0,0
    09/25/2012 11:38:40,1.99,0,0,0,0
    09/25/2012 11:39:00,1.99,0,0,0,0
    09/25/2012 11:39:20,1.99,0,0,0,0
    09/25/2012 11:39:40,1.99,0,0,0,0
    09/25/2012 11:40:00,0.99,0,0,0,0
    09/25/2012 11:40:20,0.99,0,0,0,0
    09/25/2012 11:40:40,0.99,0,0,0,0
    09/25/2012 11:41:00,0.99,0,0,0,0
    09/25/2012 11:41:20,2.99,0,0,0,0
    09/25/2012 11:41:40,2.99,0,0,0,0
    09/25/2012 11:42:00,2.99,0,0,0,0
    09/25/2012 11:42:20,2.99,0,0,0,0
    09/25/2012 11:42:40,2.99,0,0,0,0
    09/25/2012 11:43:00,0.99,0,0,0,0
    09/25/2012 11:43:20,0.99,0,0,0,0
    09/25/2012 11:43:40,0.99,0,0,0,0
    09/25/2012 11:44:00,0.99,0,0,0,0
    09/25/2012 11:44:20,0.99,0,0,0,0
    09/25/2012 11:44:40,0.99,0,0,0,0
    09/25/2012 11:45:00,0.99,0,0,0,0
    09/25/2012 11:45:20,0.99,0,0,0,0
    09/25/2012 11:45:40,0.99,0,0,0,0
    09/25/2012 11:46:00,0.99,0,0,0,0
    09/25/2012 11:46:20,0.99,0,0,0,0
    09/25/2012 11:46:40,0.99,0,0,0,0
    09/25/2012 11:47:00,0.99,0,0,0,0
    09/25/2012 11:47:20,0.99,0,0,0,0
    09/25/2012 11:47:40,0.99,0,0,0,0
    09/25/2012 11:48:00,0.99,0,0,0,0
    09/25/2012 11:48:20,0.99,0,0,0,0
    09/25/2012 11:48:40,0.99,0,0,0,0
    09/25/2012 11:49:00,0.99,0,0,0,0
    09/25/2012 11:49:20,0.99,0,0,0,0
    09/25/2012 11:49:40,0.99,0,0,0,0
    09/25/2012 11:50:00,0.99,0,0,0,0
    09/25/2012 11:50:20,1.99,0,0,0,0
    09/25/2012 11:50:40,1.99,0,0,0,0
    09/25/2012 11:51:00,0.99,0,0,0,0
    09/25/2012 11:51:20,0.99,0,0,0,0
    09/25/2012 11:51:40,0.99,0,0,0,0
    09/25/2012 11:52:00,0.99,0,0,0,0
    09/25/2012 11:52:20,0.99,0,0,0,0
    09/25/2012 11:52:40,0.99,0,0,0,0
    09/25/2012 11:53:00,0.99,0,0,0,0
    09/25/2012 11:53:20,0.99,0,0,0,0
    09/25/2012 11:53:40,0.99,0,0,0,0
    09/25/2012 11:54:00,0.99,0,0,0,0
    09/25/2012 11:54:20,0.99,0,0,0,0
    09/25/2012 11:54:40,0.99,0,0,0,0
    09/25/2012 11:55:00,0.99,0,0,0,0
    09/25/2012 11:55:20,0.99,0,0,0,0
    09/25/2012 11:55:40,0.99,0,0,0,0
    09/25/2012 11:56:00,0.99,0,0,0,0
    09/25/2012 11:56:20,0,0,0,0,0
    09/25/2012 11:56:40,0,0,0,0,0
    09/25/2012 11:57:00,0,0,0,0,0
    09/25/2012 11:57:20,0.99,0,0,0,0
    09/25/2012 11:57:40,0.99,0,0,0,0
    09/25/2012 11:58:00,0.99,0,0,0,0
    09/25/2012 11:58:20,0.99,0,0,0,0
    09/25/2012 11:58:40,0.99,0,0,0,0
    09/25/2012 11:59:00,0,0,0,0,0
    09/25/2012 11:59:20,0,0,0,0,0
    09/25/2012 11:59:40,0,0,0,0,0
    09/25/2012 12:00:00,0,0,0,0,0
    09/25/2012 12:00:20,0,0,0,0,0
    09/25/2012 12:00:40,0,0,0,0,0
    09/25/2012 12:01:00,0,0,0,0,0
    09/25/2012 12:01:20,0,0,0,0,0
    09/25/2012 12:01:40,0,0,0,0,0
    09/25/2012 12:02:00,0,0,0,0,0
    09/25/2012 12:02:20,0,0,0,0,0
    09/25/2012 12:02:40,0,0,0,0,0
    09/25/2012 12:03:00,0,0,0,0,0
    09/25/2012 12:03:20,0,0,0,0,0
    09/25/2012 12:03:40,0,0,0,0,0
    09/25/2012 12:04:00,0,0,0,0,0
    09/25/2012 12:04:20,0,0,0,0,0
    09/25/2012 12:04:40,0,0,0,0,0
    09/25/2012 12:05:00,0,0,0,0,0
    09/25/2012 12:05:20,0,0,0,0,0
    09/25/2012 12:05:40,0,0,0,0,0
    09/25/2012 12:06:00,0,0,0,0,0
    09/25/2012 12:06:20,0,0,0,0,0
    09/25/2012 12:06:40,0,0,0,0,0
    09/25/2012 12:07:00,0,0,0,0,0
    09/25/2012 12:07:20,0,0,0,0,0
    09/25/2012 12:07:40,0.99,0,0,0,0
    09/25/2012 12:08:00,0.99,0,0,0,0
    09/25/2012 12:08:20,0.99,0,0,0,0
    09/25/2012 12:08:40,0.99,0,0,0,0
    09/25/2012 12:09:00,0.99,0,0,0,0
    09/25/2012 12:09:20,0.99,0,0,0,0
    09/25/2012 12:09:40,0.99,0,0,0,0
    09/25/2012 12:10:00,0.99,0,0,0,0
    09/25/2012 12:10:20,0,0,0,0,0
    09/25/2012 12:10:40,0,0,0,0,0
    09/25/2012 12:11:00,0,0,0,0,0
    09/25/2012 12:11:20,0.99,0,0,0,0
    09/25/2012 12:11:40,0.99,0,0,0,0
    09/25/2012 12:12:00,0.99,0,0,0,0
    09/25/2012 12:12:20,1.99,0,0,0,0
    09/25/2012 12:12:40,1.99,0,0,0,0
    09/25/2012 12:13:00,1.99,0,0,0,0
    09/25/2012 12:13:20,0.99,0,0,0,0
    09/25/2012 12:13:40,1.99,0,0,0,0
    09/25/2012 12:14:00,1.99,0,0,0,0
    09/25/2012 12:14:20,1.99,0,0,0,0
    09/25/2012 12:14:40,1.99,0,0,0,0
    09/25/2012 12:15:00,2.99,0,0,0,0
    09/25/2012 12:15:20,2.99,0,0,0,0
    09/25/2012 12:15:40,2.99,0,0,0,0
    09/25/2012 12:16:00,2.99,0,0,0,0
    09/25/2012 12:16:20,2.99,0,0,0,0
    09/25/2012 12:16:40,2.99,0,0,0,0
    09/25/2012 12:17:00,2.99,0,0,0,0
    09/25/2012 12:17:20,2.99,0,0,0,0
    09/25/2012 12:17:40,2.99,0,0,0,0
    09/25/2012 12:18:00,2.99,0,0,0,0
    09/25/2012 12:18:20,1.99,0,0,0,0
    09/25/2012 12:18:40,1.99,0,0,0,0
    09/25/2012 12:19:00,1.99,0,0,0,0
    09/25/2012 12:19:20,1.99,0,0,0,0
    09/25/2012 12:19:40,1.99,0,0,0,0
    09/25/2012 12:20:00,1.99,0,0,0,0
    09/25/2012 12:20:20,2.99,0,0,0,0
    09/25/2012 12:20:40,2.99,0,0,0,0
    09/25/2012 12:21:00,2.99,0,0,0,0
    09/25/2012 12:21:20,1.99,0,0,0,0
    09/25/2012 12:21:40,1.99,0,0,0,0
    09/25/2012 12:22:00,1.99,0,0,0,0
    09/25/2012 12:22:20,0.99,0,0,0,0
    09/25/2012 12:22:40,0.99,0,0,0,0
    09/25/2012 12:23:00,0.99,0,0,0,0
    09/25/2012 12:23:20,1.99,0,0,0,0
    09/25/2012 12:23:40,1.99,0,0,0,0
    09/25/2012 12:24:00,1.99,0,0,0,0
    09/25/2012 12:24:20,0.99,0,0,0,0
    09/25/2012 12:24:40,0.99,0,0,0,0

    Graph problem with a line full of zero #8427

    Dimitar
    Participant

    Hi jros,

    Please provide us with your chart initialization, too.

    Best Regards,
    Dimitar

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

    Graph problem with a line full of zero #8429

    jros
    Member

    var source =
    {
    datatype: “csv”,
    datafields: [
    { name: ‘Fecha’ },
    { name: ‘uso’ },
    { name: ‘swapin’ },
    { name: ‘vmmemctl’ },
    { name: ‘swapout’ },
    { name: ‘swapped’ }
    ],
    url: ‘/valoresRendimiento.php?tipo=mem’
    };
    var dataAdapter = new $.jqx.dataAdapter(source, { async: false, autoBind: true, loadError: function (xhr, status, error) { alert(‘Error loading “‘ + source.url + ‘” : ‘ + error); } });
    var settings = {
    title: “SIN SELECCIONAR”,
    description: “Memoria RAM”,
    enableAnimations: true,
    showLegend: true,
    padding: { left: 10, top: 5, right: 10, bottom: 5 },
    titlePadding: { left: 90, top: 0, right: 0, bottom: 10 },
    source: dataAdapter,
    categoryAxis:
    {
    dataField: ‘Fecha’,
    unitInterval: 36,
    textRotationAngle: 40,
    },
    colorScheme: ‘scheme04’,
    seriesGroups:
    [
    {
    type: ‘line’,
    columnsGapPercent: 30,
    seriesGapPercent: 0,
    valueAxis:
    {
    description: ‘KB’,
    tickMarksColor: ‘#888888’,
    minValue: 0
    },
    series: [
    { dataField: ‘swapin’, displayText: ‘Swap in’ },
    { dataField: ‘vmmemctl’, displayText: ‘Balloon’ },
    { dataField: ‘swapout’, displayText: ‘Swap out’ },
    { dataField: ‘swapped’, displayText: ‘Swapped’ }
    ]
    },
    {
    type: ‘line’,
    valueAxis:
    {
    description: ‘%’,
    minValue: 0,
    maxValue: 100,
    tickMarksColor: ‘#888888’
    },
    series: [
    { dataField: ‘uso’, displayText: ‘Uso %’ }
    ]
    }
    ]
    };
    $(‘#jqxChart_Avantaas_rendimiento_frame_view_chartmem’).jqxChart(settings);

    Graph problem with a line full of zero #8431

    Dimitar
    Participant

    Hi jros,

    Thank you for your feedback. We will take your issue under further consideration.

    Best Regards,
    Dimitar

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

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

You must be logged in to reply to this topic.