Hitachi Vantara Pentaho Community Forums
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Real-time?

  1. #1

    Default Real-time?

    Hello.

    I am here again with my problems.

    I am trying to do a real-time chart. Something like this: http://bost.ocks.org/mike/path/

    My problem is, that I do not know the Pentahos own CDA\CDF\CCC -commands that could be used to fetch and refresh the query that qets the data.
    I know that you can put a refresh period on a CCC-chart and even prevent that refresh from binding the whole screen with white blink.
    But the problem is, that the chart itself still blinks if we use the refresh period option and it does not look smooth real-time chart.

    How can I manage and update the query through pre-exection for example? Is it possible to make a real-time chart in Pentaho ccc charts..? It should not be a big magic trick, but I just don't know where to put the data and how to fetch it through the javascript. If you have any idea what I am trying to do, please help or reference or something.. It would be a great help not only for me, but to other forum members also. Real-time is something that is trending now.

    I also tried to download the x-pand it fusioncharts plugin, where they offer real-time charts. But when I put my CDA-file to the path and accesid to the query I would like to use, nothing happes. Not even the chart shows up in anyway to the dashboard. So I really do not know what I am doing wrong in that category either... :/ If you can help with this fusionchart problem also, or only in this, it would be superb!



    Cheers,
    Niko

    Edit.
    No wonder nothing could be seen.. The real-time charts are not provided in the free-license.
    Well... I still need some kinda resolution to get one somehow..
    Last edited by nobomopo; 08-08-2014 at 06:24 AM. Reason: More info

  2. #2
    Join Date
    Nov 2011
    Posts
    1,229

    Default

    Hey.

    Real-time functionality is not provided by CCC at this point. It shouldn't be very hard to implement, but you'd need to short circuit the CDF component update cycle and explicitly call the underneath chart refresh method.
    I'd suggest you investigate the CCC API and the way the CCC components are built in CDF.
    Pedro Vale
    --
    CTools Product Development
    http://www.webdetails.pt

  3. #3

    Default

    Quote Originally Posted by pamval View Post
    Hey.

    Real-time functionality is not provided by CCC at this point. It shouldn't be very hard to implement, but you'd need to short circuit the CDF component update cycle and explicitly call the underneath chart refresh method.
    I'd suggest you investigate the CCC API and the way the CCC components are built in CDF.
    Allright, good to know. Umm.. Could you point me the way, where I can find these documentations? Maybe I will find some kinda solution someday .. I am not so good a coder, but if it is doable, hopefully the answer will be found.

  4. #4
    Join Date
    Nov 2011
    Posts
    1,229

    Default

    Full API reference for CCC is here: http://www.webdetails.pt/ctools/charts/jsdoc/

    Best way to understand how the CCC components are built is the source code itself: https://github.com/webdetails/cdf/bl...ponents/ccc.js
    Pedro Vale
    --
    CTools Product Development
    http://www.webdetails.pt

  5. #5
    Join Date
    Mar 2012
    Posts
    645

    Default

    Quote Originally Posted by nobomopo View Post
    Hello.
    I know that you can put a refresh period on a CCC-chart and even prevent that refresh from binding the whole screen with white blink.
    But the problem is, that the chart itself still blinks if we use the refresh period option and it does not look smooth real-time chart.
    What do you mean with the chart still blinking?
    Did you use the: this.lifecycle = {silent: true} technique on the chart component to hide the "loading" indicator?
    Or do you mean that, despite the loading indicator not showing up, the chart does not animate smoothly to the new values?

    The later, yep, I understand. CCC charts don't currently animate between data reloads. The best you can do is to reload frequently enough so that the shifting of visual elements is small...

  6. #6

    Default

    Quote Originally Posted by duarte.leao View Post
    What do you mean with the chart still blinking?
    Did you use the: this.lifecycle = {silent: true} technique on the chart component to hide the "loading" indicator?
    Or do you mean that, despite the loading indicator not showing up, the chart does not animate smoothly to the new values?

    The later, yep, I understand. CCC charts don't currently animate between data reloads. The best you can do is to reload frequently enough so that the shifting of visual elements is small...
    Hi duarte.

    Yes I did use the this.lifesycle = {silent: true} technique on the chart component. So it prevents the whole screen white flash with indicator to show up.
    But after that, the cart still kinda refreshes itself with flash where the chart is not visible for a few millisecond or something..
    The most frequently possible to load with CCC-refresh interval options is 1 sec?

    And to pamval,
    Thanks for the links. I will look into those, if I can understand something.

  7. #7
    Join Date
    Mar 2012
    Posts
    645

    Default

    Oh, yes, I see.
    The component's placeholder is cleared before data fetching, and this gives that flicker, on every re-execution/re-update.
    About the last question, on the minimum CCC refresh interval, note that the refresh interval is a CDF feature that allows re-executing components at fixed intervals. I'm not sure if there's a minimum. Maybe there is one, if you set the property through the CDE property.
    Anyway, making it smaller shouldn't make that flicker go away.

  8. #8

    Default

    Quote Originally Posted by duarte.leao View Post
    Oh, yes, I see.
    The component's placeholder is cleared before data fetching, and this gives that flicker, on every re-execution/re-update.
    About the last question, on the minimum CCC refresh interval, note that the refresh interval is a CDF feature that allows re-executing components at fixed intervals. I'm not sure if there's a minimum. Maybe there is one, if you set the property through the CDE property.
    Anyway, making it smaller shouldn't make that flicker go away.
    Yes, that flicker is the most annoying thing there. If that could somehow be prevented it would be very cool.
    And also if it would be achievable without any js-sorcery, like saving some png from the current status while the chart is refreshing and clearing.. Heh.
    Do not know if that is even possible at the moment.

    And the CCC-chart only accepts Numeric value to Refresh period.. And the first number it allows is 1. No 0.1 or anything else double numbers.

  9. #9
    Join Date
    Mar 2012
    Posts
    645

    Default

    I'm afraid that JS sorcery is required in the current state of affairs...

    Please create a CDF issue complaining about the flicker and asking for a way to not clear the container in the beginning of the execution, but just before rendering (in CccComponent#render).

    Disclaimer: with great power comes great responsibility!

    Until that's developed, you can, at your own risk, patch the CDF chart component code. Place the following in a script resource in your dashboard, called something like "CDF Patch for DateOfYourCDFVersion - No Clear Placeholder Begin Execution":

    Code:
    CccComponent.prototype.update: function() {    if(this.parameters == null) {
            this.parameters = [];
        }
    
    
        // clear placeholder
        var ph = $("#"+this.htmlObject);
        var me = this;
    
    
        // Set up defaults for height and width
        if(typeof(this.chartDefinition.width) === "undefined")
            this.chartDefinition.width = ph.width();
    
    
        if(typeof(this.chartDefinition.height) === "undefined")
            this.chartDefinition.height = ph.height();
    
    
        if (typeof Modernizr !== 'undefined' && Modernizr.svg) {
            this.renderChart();
        } else {
            pv.listenForPageLoad(function() {
                me.renderChart();
            });
        }
    };
    
    CccComponent.prototype.render: function(values) {
    
    
        $("#" + this.htmlObject).empty().append('<div id="'+ this.htmlObject  +'protovis"></div>');
    
    
        this._preProcessChartDefinition();
    
    
        var o = $.extend({},this.chartDefinition);
        o.canvas = this.htmlObject+'protovis';
        // Extension points
        if(typeof o.extensionPoints != "undefined"){
            var ep = {};
            o.extensionPoints.forEach(function(a){
                ep[a[0]]=a[1];
            });
            o.extensionPoints=ep;
        }
    
    
        this.chart =  new this.cccType(o);
        if(arguments.length > 0){
            this.chart.setData(values,{
                crosstabMode: this.crosstabMode,
                seriesInRows: this.seriesInRows
            });
        }
        this.chart.render();
    };
    That simply changed the jQuery #empty() call from the #update method to the #render method.

    In what the refresh period is concerned, if after this fix you still want to decrease the refresh period, you can do it in preExecution:
    function() {
    this.refreshPeriod = 0.5; // every half second
    }

  10. #10

    Default

    Ok, thank you duarte.

    I will try that codesnippet in somepoint. Actually know that I still remember, is there some kinda cheat sheet where you can find all the pentaho\javascript variables? Looking that this.refreshPeriod for example, remembered me some dashboard.firechange and such things to my mind. Is there a cheat sheet for these or some kinda collection?

    Funny tho' that it worked every half second but not every tenth of a second Well have to do some flicked complaining then to somewhere. That refreshperiod seems to be pretty fast already.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.