jQWidgets Forums

Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • in reply to: Hiding tickmark values/Legend Hiding tickmark values/Legend #23320

    jondecker76
    Member

    Thanks for the reply

    This works, but then the value reference disappears from the tooltips for the datapoints. Is there any way to keep those with the method you showed in this thread?

    thanks again

    in reply to: Data adapter, changing URL? Data adapter, changing URL? #23185

    jondecker76
    Member

    Disregard, I was able to get this to work finally. Here is what I did:

    			// Change trend depending on which button was clicked                
    $('#buttonsTrend').on('buttonclick', function (event) {
    var clickedButton = event.args.button;
    source.url="trenddata.php?units="+clickedButton[0].id;
    var dataAdapter= new $.jqx.dataAdapter(source);
    $('#trendDash').jqxChart({source: dataAdapter});
    $('#trendDash').jqxChart({description: "Last "+clickedButton[0].id});
    });
    in reply to: Chart data format? Chart data format? #23179

    jondecker76
    Member

    Thanks very much. I’ve used the dataAdapter and now have it working 🙂

    in reply to: Chart data format? Chart data format? #23118

    jondecker76
    Member

    Adding to previous post..

    I just added “timestamp” to the JSON data, thinking maybe this would help. Here is the JSON data now:

    [{"timestamp":"1370876348","windspeed":"4","rpm":"0","kw":"0"},{"timestamp":"1370876338","windspeed":"4","rpm":"0","kw":"0"},{"timestamp":"1370876328","windspeed":"4","rpm":"0","kw":"0"},{"timestamp":"1370876318","windspeed":"4","rpm":"0","kw":"0"},{"timestamp":"1370876308","windspeed":"4","rpm":"0","kw":"0"},{"timestamp":"1370876298","windspeed":"5","rpm":"0","kw":"0"},{"timestamp":"1370876288","windspeed":"5","rpm":"0","kw":"0"},{"timestamp":"1370876278","windspeed":"5","rpm":"0","kw":"0"},{"timestamp":"1370876268","windspeed":"4","rpm":"0","kw":"0"},{"timestamp":"1370876258","windspeed":"4","rpm":"0","kw":"0"}]

    Still just a blank chart though 🙁

    in reply to: Chart data format? Chart data format? #23116

    jondecker76
    Member

    I’m still getting absolutely nowhere with this. I have a php script returning JSON data. Here is the script’s output:

    [{"windspeed":"4","rpm":"0","kw":"0"},{"windspeed":"4","rpm":"0","kw":"0"},{"windspeed":"4","rpm":"0","kw":"0"},{"windspeed":"4","rpm":"0","kw":"0"},{"windspeed":"4","rpm":"0","kw":"0"},{"windspeed":"5","rpm":"0","kw":"0"},{"windspeed":"5","rpm":"0","kw":"0"},{"windspeed":"5","rpm":"0","kw":"0"},{"windspeed":"4","rpm":"0","kw":"0"},{"windspeed":"4","rpm":"0","kw":"0"}]

    I’m trying to get this data to display as 3 series in a stacked spline chart. The data is the last 10 logged readings from the wind turbine (values are logged to MySQL every 10 seconds by a daemon script) . I’ve tried to bind the data to the chart, but the chart just comes up blank…

    Here is the code I’m trying to use to set up the chart:

     // prepare the data
    var source ={
    datatype: "json",
    datafields: [{ name: 'windspeed' },{ name: 'rpm' },{ name: 'kw' }],
    url: 'trenddata.php'
    };
    var settings = {
    title: "Trend",
    description: "Logged every 10 seconds",
    padding: { left: 5, top: 5, right: 5, bottom: 5 },
    titlePadding: { left: 90, top: 0, right: 0, bottom: 10 },
    source: source,
    colorScheme: 'scheme01',
    seriesGroups:
    [
    {
    type: 'stackedsplinearea',
    valueAxis:
    {
    minValue: 0,
    maxValue: 2000,
    unitInterval: 10,
    description: 'Value'
    },
    series: [
    { dataField: 'windspeed', displayText: 'Windspeed'},
    { dataField: 'rpm', displayText: 'RPM'},
    { dataField: 'kw', displayText: 'KW'}
    ]
    }
    ]
    };
    // select the chartContainer DIV element and render the chart.
    $('#trendDash').jqxChart(settings);

    I’ve even tried a full http URL for the source URL with no luck.

    What am I doing wrong?

    in reply to: Chart data format? Chart data format? #23022

    jondecker76
    Member

    Thank you for your reply.

    Hmm.. That didn’t help me as much as I thought it would unfortunately. Perhaps if I describe a bit more someone can help me out a little.

    I have a small PHP daemon that runs and logs windspeed, RPM and Kilowatts from my wind turbine every 10 seconds, storing each with a Unix timestamp.

    I would like to display the data as 3 series just like the area spline series demo, but with “Windspeed”,” RPM” and “KW” instead of “Interest Rate”, “Building Cost Index” and “Real Home Price Index”. (see: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxchart/index.htm#demos/jqxchart/javascript_chart_areaspline_series.htm)

    The problem I am having is that all examples that I see, the X-axis contains known values, where my X-axis will be my Unix timestamp (which will constantly change). I’m basically trying to build a trend of values over time, and have it update once each minute. I’m having a hard time visualizing how such data can be presented…

    Thanks again

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