dimple bar graph order problems
having trouble getting the bar sort order
by Henry
HTML
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://dimplejs.org/dist/dimple.v2.1.2.min.js"></script>
CSS
.dimple-custom-axis-label{
font-style: normal !important;
font-variant: normal !important;
font-weight: normal !important;
font-stretch: normal !important;
font-size: 7pt !important;
line-height: normal !important;
font-family: 'Lucida Sans Unicode' !important;
}
JavaScript
String.prototype.startsWith = function(str)
{return (this.match("^"+str)==str);}
String.prototype.endsWith = function(str)
{return (this.match(str+"$")==str);}
String.prototype.contains = function(it)
{ return this.indexOf(it) != -1; };
String.prototype.replaceAt=function(index, character)
{return this.substr(0, index) + character + this.substr(index+character.length);}
Number.prototype.format = function(n, x) {
var re = '\\d(?=(\\d{' + (x || 3) + '})+' + (n > 0 ? '\\.' : '$') + ')';
return this.toFixed(Math.max(0, ~~n)).replace(new RegExp(re, 'g'), '$&,');
};
var myLegend, svg, x, y, all, data, myChart;
var w = window,
d = document,
e = d.documentElement,
g = d.getElementsByTagName('body')[0],
Ax = w.innerWidth || e.clientWidth || g.clientWidth,
Ay = w.innerHeight|| e.clientHeight|| g.clientHeight;
function desenha(){
w = window;
d = document;
e = d.documentElement;
g = d.getElementsByTagName('body')[0];
Ax = w.innerWidth || e.clientWidth || g.clientWidth;
Ay = w.innerHeight|| e.clientHeight|| g.clientHeight;
svg = dimple.newSvg("body",Ax ,Ay);
data = [
{"Ano":"2013","Tipo":"Contratado","Valor": 3000.00,"Min_Ano":"2013"}
,{"Ano":"2013","Tipo":"Comprometido","Valor": 15000.00,"Min_Ano":"2013"}
,{"Ano":"2013","Tipo":"Pago","Valor": 0.00,"Min_Ano":"2013"}
,{"Ano":"2014","Tipo":"Contratado","Valor": 650000.00,"Min_Ano":"2013"}
,{"Ano":"2014","Tipo":"Comprometido","Valor": 0.00,"Min_Ano":"2013"}
,{"Ano":"2014","Tipo":"Pago","Valor": 0.00,"Min_Ano":"2013"}
,{"Ano":"2015","Tipo":"Contratado","Valor": 30000.00,"Min_Ano":"2013"}
,{"Ano":"2015","Tipo":"Comprometido","Valor": 30000.00,"Min_Ano":"2013"}
,{"Ano":"2015","Tipo":"Pago","Valor": 90000.00,"Min_Ano":"2013"}
...