jQWidgets Forums

jQuery UI Widgets Forums Chart Candlestick Chart Updates

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

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Candlestick Chart Updates #63854

    Al
    Participant

    I am having trouble updating candlestick charts. I started with the sample and added my own update function as follows:
    chart = $(‘#chartContainer’).jqxChart(‘getInstance’);

    function addCandle(message) {
    if (candles.constructor === Array) {
    var c = {};candles = chart.source.records;
    c[‘Date’] = message.LastUpdate;
    c[‘SPOpen’] = message.ContinuousCandlePortable.Open;
    c[‘SPHigh’] = message.ContinuousCandlePortable.High;
    c[‘SPLow’] = message.ContinuousCandlePortable.Low;
    c[‘SPClose’] = message.ContinuousCandlePortable.Closebid;
    c[‘SPVolume’] = message.ContinuousCandlePortable.Volume;
    candles.push(c);
    chart.update();
    }}

    when addCandle is called the chart disappears. all the functions are called without problem and the data in the candle is valid.

    2 questions:

    1) is there a sample available that updates candlestick charts?
    2) I notice a member uid in the samples chart.source.records, where is that coming from? is that inserted by the data adapter?

    Thanks a lot,

    Candlestick Chart Updates #63859

    Al
    Participant

    I am using the baseUnit to be 1 sec on x axis. Could that be a problem?

    xAxis:
    {
    dataField: ‘Date’,
    formatFunction: function (value) {
    return value.getDate() + ‘-‘ + months[value.getMonth()] + ‘\” + value.getFullYear().toString().substring(2);
    //return $.jqx.dataFormat.formatdate(value, “hh:mm:ss”, ‘en-us’);
    },
    type: ‘date’,
    baseUnit: ‘second’,
    unitInterval: 10,
    valuesOnTicks: true,
    minValue: new Date(2014, 12, 5, 18),
    maxValue: new Date(2014, 12, 5, 19)

    Candlestick Chart Updates #63863

    Peter Stoev
    Keymaster

    Hello Al,

    I would suggest you to provide a full example and preferably post it in jsfiddle. I would also suggest you to check again your Chart’s initialization code and how you update the Chart. Basically, it does not matter whether you update Line, Cadlestick, Column or other Chart type.

    Best Regards,
    Peter Stoev

    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.