I have three identical objects that I'd like to define in three slightly different ways. The only difference is that I'm accessing a different property within my source data (via Bracket Notation) for each object as shown below

The object I'm using is not a function. For example Object1 is defined by 

```
var Object1  = dc.lineChart("#chart-line-hitsperday"); 

var D = "Dimension1"
Object1
    .width(200).height(200)
    .dimension(SourceData.dimension(function (d) {return d[D];}))
    .group(SourceData.dimension(function (d) {return d[D];}).group().reduceSum(function (d) {return d.Amount;}))

var D = "Dimension2"
Object2
    .width(200).height(200)
    .dimension(SourceData.dimension(function (d) {return d[D];}))
    .group(SourceData.dimension(function (d) {return d[D];}).group().reduceSum(function (d) {return d.Amount;}))

var D = "Dimension3"
Object3
    .width(200).height(200)
    .dimension(SourceData.dimension(function (d) {return d[D];}))
    .group(SourceData.dimension(function (d) {return d[D];}).group().reduceSum(function (d) {return d.Amount;}))

```

Is there a way that I can define each with 1 line of code as oppose to three lines of code. In other words, I'd like to convert above into the following 

```
Object1.definition("Dimension1")
Object2.definition("Dimension2")
Object3.definition("Dimension3")

```

by defining 'definition' as something like :

```
definition(D) =         
    .width(200).height(200)
    .dimension(SourceData.dimension(function (d) {return d[D];}))
    .group(SourceData.dimension(function (d) {return d[D];}).group().reduceSum(function (d) {return d.Amount;}))

```

Is this possible?

See JSFiddle Here: <http://jsfiddle.net/chrisguzman/juhaoem2/>

I've tried the following with no luck: 

```
var definition = function(D){     
    this.width(200).height(200)
    .dimension(SourceData.dimension(function (d) {return d[D];}))
    .group(SourceData.dimension(function (d) {return d[D];}).group().reduceSum(function (d) {return d.Amount;}))
}

Object1.definition("Dimension1")

```

Second Try

```
Object1.prototype.definition = function(dim){
    this.width(200).height(200)
        .dimension(SourceData.dimension(function (d) {return d[dim];}))
        .group(SourceData.dimension(function (d) {return d[dim];}).group().reduceSum(function (d) {return d.Amount;}))
};

```