Search code examples
dashboardpubnubc3.js

EON chart populate from history


I am using PubNub EON chart and I want to use the populate from history feature. However, when I set history:true the chart never populates with anything. When I set history:false then it works great. Here is the declaration:

<script>
    var pubnub = PUBNUB.init({
        subscribe_key: '------------------------------------',
        ssl: true
    });
    eon.chart({
        pubnub: pubnub,
        history: false,
        channel: 'tempTime',
        limit: 2880,
        ssl: true,
        debug: false,
        generate: {
            transition: {
                duration: 3
            },
            bindto: '#TimeSeries',
            point: {
                show: false
            },
            data: {
                x: 'x'
            },
            subchart: {
                show: true,
                tick: {
                        count: 12,
                        format: '%H:%M',
                        culling: {
                            max: 12 // the number of tick texts will be adjusted to less than this value
                        }
                    }
            },
            zoom: {
                enabled: false
            },
            axis: {
                x: {
                    type: 'timeseries',
                    tick: {
                        count: 24,
                        format: '%H:%M',
                        culling: {
                            max: 12 // the number of tick texts will be adjusted to less than this value
                        }
                    }
                }
            }
        },
        transform: function(tempTime) {
            return {
                eon: {
                    'Ice Tank Outlet': tempTime.T0,
                    'Load Outlet': tempTime.T1,
                    'Ice RC to Water RC': tempTime.T4,
                    'Column Inlet': tempTime.T5,
                    'Condenser Dist.': tempTime.T6,
                    'Brine RC to Ice Tank': tempTime.T7,
                    'Ice Tank Inlet': tempTime.T8,
                    'Dist. Water': tempTime.T9,
                    'Chilled Water': tempTime.T11,
                    'Distillate': tempTime.T13,
                    'Chilled Coolant': tempTime.T16,
                    'RC Coolant': tempTime.T18,
                    'Warm Coolant': tempTime.T19,
                    'Brine RC to Column': tempTime.T20,
                    'Water RC to Column': tempTime.T21,
                    'Ambient': tempTime.T22
                }
            }
        }
    });

Solution

  • Enable Storage & Playback add-on for your keys in the PubNub Admin Dashboard.