jQWidgets Forums

jQuery UI Widgets Forums Chart Loading CSV Data Into Line Chart

This topic contains 1 reply, has 1 voice, and was last updated by  AllThumbsGeek 12 years ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Loading CSV Data Into Line Chart #20042

    All,

    My demo of this to myself is/was the Custom Line Styles demo and I have wasted the whole day trying to get it to work for me. Could some one tell me where I am going wrong? The page creates the directory for the results and successfully writes the comma delimited file there, so it being there is NOT the problem. I hope I am using the code tags correctly…

    Thanks,

    ATG


    // New chart data source setup
    var chartsource =
    {
    datatype: "csv",
    datafields: [
    { name: 'Hop' },
    { name: 'Time' }
    ],
    url: 'results/google.com.txt'
    };
    var chartAdapter = new $.jqx.dataAdaptor(source, {async: false, autoBind: true, loadError: function (xhr, status, error) { alert('Error loading "' + chartsource.url + '" : ' + error); } });
    var hops = ['Hop 1', 'Hop 2', 'Hop 3', 'Hop 4', 'Hop 5', 'Hop 6', 'Hop 7', 'Hop 8', 'Hop 9', 'Hop 10', 'Hop 11', 'Hop 12'];

    // prepare jqxChart settings
    var settings = {
    title: “Per-Hop Path Characterization”,
    description: “Overview of per-hop performance and metrics”,
    padding: { left: 20, top: 5, right: 30, bottom: 5 },
    titlePadding: { left: 90, top: 0, right: 0, bottom: 10 },
    source: chartAdapter,
    categoryAxis:
    {
    dataField: ‘Hop’,
    showGridLines: false
    },
    colorScheme: ‘scheme01’,
    seriesGroups:
    [
    {
    type: ‘line’,
    columnsGapPercent: 20,
    seriesGapPercent: 0,
    symbolType:’triangle_up’,
    formatSettings: {
    sufix: ‘ms’
    },
    valueAxis:
    {
    minValue: 0,
    maxValue: 100,
    unitInterval: 10,
    axisSize: ‘auto’,
    description: ‘Time in milliseconds’
    },
    series: [
    { dataField: ‘Time’, displayText: ‘Time’ }
    ]
    }
    ]
    };
    // select the chartContainer DIV element and render the chart.
    $(‘#chart’).jqxChart(settings);

    Loading CSV Data Into Line Chart #20074

    All,

    Since there has not been any response to my post I thought I would update my own progress.

    After several hours more comparing line from example to line from code I changed 2 things, but remain unconvinced either should be necessary. First change was I copied the dataAdapter code from the demo and pasted it underneath my dataAdapter code so I could line things up. The difference was a space in the dataAdapter line after { and before the word async from demo to my code. In anguished desperation despite the trivial possibility of it making a difference, I added the space. Second was that I changed the entire web root file system on my Fedora laptop using chmod -R 0777 from /var/www/html. After losing a full day this works on my laptop. I note that the downloaded archive demos do not require more than chmod 0755 to run just fine…

    Unless anyone has any words of wisdom I am moving on to importing yet another multidimensional array into a grid control.

    ATG

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

You must be logged in to reply to this topic.