Forum Discussion

ShoshanaBokelma's avatar
ShoshanaBokelma
Qrew Trainee
7 years ago

Statistical Process Control Charts

Would you recommend using google charts or something else to implement SPC charts in my QB app?   Can you please point me to information on how?

9 Replies

    • DavidHawe's avatar
      DavidHawe
      Qrew Trainee
      They look useful.  Thanks for the tip.
  • A few years ago, I used Trinity, one of the official Quick Base Solution Providers for some charts that have trend lines (linear regression) in them. 
  • Thanks to you both!  But if I want to code them myself, what do you recommend?  (I need something "free".)
  • You can modify a QuickBase rendered chart to add additional graphical features such as trend lines or asymptotes. However a Statistical Process Control Charts can have all sorts of more complex features such as histograms, annotations or secondary scales:

    Google Image Search: Statistical Process Control Charts
    https://www.google.com/search?q=Statistical+Process+Control+Charts&tbm=isch

    If your SPC Chart just needs simple modifications from a native QuickBase Chart you can use the UnHighCharted Waters technique to modify a QuickBase rendered chart as demonstrated here (click green button):

    Un-HighCharted Waters
    https://haversineconsulting.quickbase.com/db/bk89redf6?a=td

    See these Pasties and links within:

    https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=523
    https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=529
  • I would recommend Highcharts as that is what QuickBase already uses for its charts, so it's already bundled into the QuickBase code that renders the page and so you avoid additional overhead of having to load even more javascript for another chart library like Google Charts.

    However, there are a couple things you should know if you do this:
    1. QuickBase uses a very old version of Highcharts (3.0.2 compared to the current 5.0.14), so if you are looking at their Docs just be aware certain charts/functionality may not be available due to the version (usually it says the version # the feature was implemented in the docs).
    2. It will only load Highcharts on pages where it expects a chart already. So I would suggest creating a chart with the data that you want to create an SPC for, then taking that data from the chart and redrawing it the way you want to see it. See dandiebolt@gmail.com response for some starter code on how to do that.
  • Simple SPC
    https://haversineconsulting.quickbase.com/db/bm2kgmy77?a=dr&rid=1



    Pastie Database
    https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=592

    Notes:

    (1) I added fields to the parent record [Upper Limit], [Lower Limit], [Chart Max] and [Chart Min] but this is just window dressing. It would be easy enough to connect these parent fields to the chart or even calculate them based on child data but I do not have the time to do it at this time - maybe later.

    (2) I am delaying the re-rendering of the chart with the upper and lower limits for two seconds to emphasize that I am modifying a QuickBase's rendered chart. Other devices could be employed to hide the chart until after the original chart was rendered so only the rendering of the modified chart was displayed. Reminder to self - use code similar to this q/a

    var control = setInterval(function() {
      if(chart.series[0].finishedAnimating) {
       console.log('Animation finished');
       clearInterval(control);
      }
    }, 10);
    http://jsfiddle.net/kkulig/5cnwhm8L/