ExtJS 3.4 Scatter Chart Example with Logarithmic Axis

Problem You are rendering data that increases exponentially, and wish display a chart with a log-scale axis. Exponential data: Logarithmic scale rendering of the same: Solution Set the “scale” property of the relevant axis to “logarithmic.” Discussion There does not seem to be any way to control the frequency of the major/minor tick marks other […]

ExtJS 3.4 Trendline Example

Problem You want to display a trend line on a scatter chart in ExtJS 3.4. Solution Use the Ext.chart.Chart class, but add an extra series for the trend-line, and make the colors match the corresponding series related to the trend. Discussion ExtJS is able to make nice-looking charts, using YUI charts, but seems to be […]

ExtJS 3.4 Scatter Chart Example

Problem You want to display a scatter chart in ExtJS 3.4. Solution Use the Ext.chart.Chart class, and make the lines invisible. Discussion This example works by rendering an Ext line chart and setting the “alpha” (visibility) property of the lines to 0 (transparent). If you wanted to add trend lines, you’d need to add visible […]

, ,

Building a JSON webservice in R

R is a programming language for mathematics and statistics. There are several R libraries available to support web development, including rjson and RJSONIO (note case – R library names are case sensitive). RJSONIO is based on rjson, but with modifications to improve performance working with large JSON payloads. The example below returns the data required […]

,

Unit testing in R

Commentary R is a statistical programming language, with a strong focus on mathematical operations. When writing code that is math-heavy, unit testing becomes very appealing- while equations may look correct on paper, one minor error can ruin the output. R programming is also different to CRUD or enterprise software in that the R in-memory data […]

, ,

Building a statistical significance testing web service powered by R

R is a programming language focused on solving statistical and mathematical calculations. R programs often operate on large, in-memory data sets, which feels somewhat similar to database programming. Examples in the R Cookbook bear a resemblence to functional programming in clojure, as others have noted. I’ve been exploring the language to gain insight into related, […]

ExtJS Area Chart Example

Problem You want to display a stacked bar chart. Solution Use the Ext.chart.Chart, and set the “series” property, including type: ‘area’. Ext.onReady(function() { Ext.define(’ParolePoint’, { extend: ‘Ext.data.Model’, fields: [’state’, ‘entry’, ‘exit’] });   var store = Ext.create(’Ext.data.Store’, { model: ‘ParolePoint’, data : [ {state: ‘Connecticut’, entry:31000, exit:28211}, {state: ‘Maine’, entry:3627, exit:3692}, {state: ‘Massachusetts’, entry:98952, exit:96142}, […]

R Error: “Error in readBin(fileR, “integer”, n = Length/2, size = 2, signed = TRUE, : invalid ‘n’ argument”

The following error is an indication that an exceptional I/O error occurred. For instance, permissions denied, out of memory, etc. Normally the syntax of this error would indicate that a required parameter is missing from a function call, but with readBin it appears to be more often an exception. Error in readBin(fileR, “integer”, n = […]

ExtJS Listener Example

Problem You want an Ext component to respond to an event. Solution Use the “listeners” property of the object. Ext.onReady(function() { var trackStore = new Ext.data.Store({ storeId: ‘soundCloudStore’,   proxy: { type: ‘ajax’, url: ‘blues.json’, reader: { type: ‘json’, idProperty: ‘id’ } }, fields:[’duration’, ‘genre’, ‘created_at’, ‘title’, ‘id’] }); trackStore.load( function() { Ext.create(’Ext.grid.Panel’, { title: […]

ExtJS Stacked Bar Chart Example

Problem You want to display a stacked bar chart. Solution Use the Ext.chart.Chart, and set the “series” property, including type: ‘bar’ and stacked: true. Ext.onReady(function() { Ext.define(’ParolePoint’, { extend: ‘Ext.data.Model’, fields: [’state’, ‘entry’, ‘exit’] });   var store = Ext.create(’Ext.data.Store’, { model: ‘ParolePoint’, data : [ {state: ‘Connecticut’, entry:31000, exit:28211}, {state: ‘Maine’, entry:3627, exit:3692}, {state: […]