Join the Wijmo v2 ++ Webcast

Next week I will be unveiling some cool new stuff in the Wijmo v2++ Webcast.

Webcast Info

Scheduled: Wednesday, May 23, 2012 2:00 PM – 3:00 PM EDT

Join Product Manager Chris Bannon as he unveils new technology from Team Wijmo. Wijmo v2 was a major release that added 15 new widgets. Since then we have been solidifying our framework and creating a platform for HTML5 development. Come take a tour through Wijmo v2 and get a glimpse of what we have coming.

Register for the webcast

We have some really great stuff releasing during this webcast. I hope to see you there!

Wijmo 2.0.8 Released

Wijmo 2.0.8 has officially released. We have been doing plenty of bug fixes and feature enhancements since 2.0.0.

Chart Data-binding Lands in Wijmo!

Chart Binding

Complex Chart with Data-binding


The biggest new feature in this release is data-binding support in our charts. We have added options that provide binding support for anything form a simple bar chart to a complex grouped bar chart.

We have added the following options to the Charts

dataSource

Option added to all defined widgets that will support binding to dataView
Type: array

data.x.bind

Defines field name used from dataSource instead of explicitly defining data as an array in the x option. This will be shared for all series in the seriesList unless overridden.
Type: string

seriesList.data.x.bind

Defines field name used from dataSource instead of explicitly defining data as an array in the x option.
Type: string

seriesList.data.y.bind

Defines field name used from dataSource instead of explicitly defining data as an array in the y option.
Type: string

Single-series Charts Bound to Array

For single series charts the dataSource should be set on the chart widget option. See this sample online

//Create Data
var data = [{
    Device: 'Desktops',
    Count: 5
},{
    Device: 'Notebooks',
    Count: 3
},{
    Device: 'Tablets',
    Count: 7
}];

$("#wijbarchart").wijbarchart({
    dataSource: data,
    seriesList: [{
        legendEntry: true,
        data: { x: { bind: "Devices" }, y: { bind: "Count" }}
    }]
});

Multi-series Charts with Shared Data Source

For multiple series charts that have a common dataset the dataSource should be set on the chart widget option. See this sample online

//Create Data
var data = [{
    Device: 'Desktops',
    Count: 5,
    Price: 900
},{
    Device: 'Notebooks',
    Count: 3,
    Price: 700
},{
    Device: 'Tablets',
    Count: 7,
    Price: 500
}];

$("#wijbarchart").wijbarchart({
    dataSource: data,
    data: { x: { bind: "Devices" }},
    seriesList: [{
        legendEntry: true,
        data: { y: { bind: "Count" }}
    },{
        legendEntry: true,
        data: { y: { bind: "Price" }}
    }]
});

Multi-series Charts with Different Data Sources

For charts with multiple series, a dataSource should be set on the chart widget option, unless different x or y fields are being used. In that case, the dataSource option can be defined for each series in the seriesList. See this sample online

var dataWest = [{
    Device: 'Desktops',
    Count: 5
}, {
    Device: 'Notebooks',
    Count: 3
}, {
    Device: 'Tablets',
    Count: 7
}],

dataEast = [{
	Device: 'Desktops',
	Count: 1
}, {
	Device: 'Notebooks',
	Count: 6
}, {
	Device: 'Tablets',
	Count: 8
}],

dataCentral = [{
	Device: 'Desktops',
	Count: 2
}, {
	Device: 'Notebooks',
	Count: 4.5
}, {
	Device: 'Tablets',
	Count: 2.5
}];

$("#wijbarchart").wijbarchart({
    seriesList: [{
    	dataSource: dataWest,
    	label: "West",
    	legendEntry: true,
    	data: { x: { bind: "Device" }, y: { bind: "Count"} }
    }, {
    	dataSource: dataEast,
    	label: "East",
    	legendEntry: true,
    	data: { x: { bind: "Device" }, y: { bind: "Count"} }
    }, {
    	dataSource: dataCentral,
    	label: "Central",
    	legendEntry: true,
    	data: { x: { bind: "Device" }, y: { bind: "Count"} }
    }]
});

Go get it!

Make sure to download the latest version of Wijmo and read the change log!

JavaScript Programming Resources

Recently I have been working with our CTO, Bernardo Castillo, on a project converting a C# application to JavaScript by hand. The syntax clearly has differences (along with similarities), but the biggest questions have come regarding principles and patterns. As we wrote the JavaScript I kept falling back to things I have read from a few very good resources throughout my affair with JavaScript programming. I compiled a short list last night and sent it to Bernardo, but thought it is something that should be made public.

If you are a C# (or any Object-oriented language) programmer looking to learn patterns and practices in JavaScript then these resources are great for inspiration and instruction. If you are already a JavaScript programmer I guarantee that there are things you can learn from the style guides. I am still learning from them.

Introduction to Object-Oriented JavaScript

https://developer.mozilla.org/en/Introduction_to_Object-Oriented_JavaScript
Author: Fernando Trasviña

Simple JavaScript Inheritance

http://ejohn.org/blog/simple-javascript-inheritance/
Author: John Resig

3 ways to define a JavaScript class

http://www.phpied.com/3-ways-to-define-a-javascript-class/
Author: Stoyan Stefanov

Principles of Writing Consistent, Idiomatic JavaScript

https://github.com/rwldrn/idiomatic.js
Author: Rick Waldron

The Elements of JavaScript Style

http://javascript.crockford.com/style1.html
Author: Douglas Crockford

Code Conventions for the JavaScript Programming Language

http://javascript.crockford.com/code.html
Author: Douglas Crockford

Essential JavaScript Design Patterns

http://addyosmani.com/resources/essentialjsdesignpatterns/book/
Author: Addy Osmani

I hope these resources help you. There a many more resources I did not mention, but these ones give experienced programmers good guidance for taking their current skills to JavaScript (the right way).

And a huge thanks the the fellas that wrote these great articles. You have helped me tremendously.