The community forums are in BETA and closed to the public.

PUBNUB EON CHART Error: Source data is missing a component at (1,1)!

Hi, I am following this example I have included punbub Subsub library library, but I get this error Source data is missing component at (1,1)

my code is

    var pubnub = PUBNUB({
          subscribe_key : 'sub'
                   });

      eon.chart({
           pubnub   : pubnub,
            history  : false,
            channel  : 'mychannel',
            flow     : true,
              generate : {
                bindto : '#chart',

                 data   : {
                 x      : 'x',
                 labels : true
                        },

                axis : {
                   x : {
                   type : 'timeseries',
                   tick : {
                format : '%H:%M:%S'
            }
        }
    }
},
transform : function(m) {
    return { columns : [
        ['x', new Date().getTime()],
        ['Checkpoint Size', m.data_clean_checkpoint_size],
        ['Checkpoint Size', m.data_clean_checkpoint_length]
    ] };
}});

Python Publish code

                     data1 = cclient.samples.list(meter_name ='checkpoint.size')
                     data2 = cclient.samples.list(meter_name ='checkpoint.length')
                      def counterVolume(data):
                                    for each in data:
                             y = each.counter_volume
                           data_clean= json.dumps(y, indent=4, separators=(',', ': '))
                            pubnub.publish(channel='mychannel', message= data_clean)


                                        counterVolume(data1)
                                        counterVolume(data2)

The value of data clean is:

89453.0
89453.0
89453.0
10101.0
10101.0
10101.0
10101.0

Can you use the pubnub console to debug the messages being sent? The console error you're getting means that some data is missing from the chart. I suspect the params you're looking for (m.data_clean_checkpoint_size) is incorrect or empty.

I checked in the console, actually the data is publishing and the parameter is also not empty but there is a single data stream so datacleancheckpointsize and datacleancheckpointlegth both are acting like a same parameter. When I run the chart it first starts to show datacleancheckpoint_size values, means that I might need to adjust my python publish function.

I can see that the data is publishing in th econsole, but the chart breaks the second I add something like ['Checkpoint Size', m.datacleancheckpoint_size], to the code

If you're publishing twice (two different publish calls), the transform function won't work properly. Try publishing both values within the same publish call.


Login or Signup to post a comment