JSFiddle - React, Tailwind, and code Playground
JavaScript
var days30fields = new Array('name');
var days30fieldsd = new Array();
var days30fieldValues = new Object();
days30fieldValues['name'] = 'Last 30 days';
for(var xd = 1; xd<31; xd++){
days30fields.push('day'+xd);
days30fieldsd.push('day'+xd);
days30fieldValues['day'+xd] = Math.floor((Math.random()*100)+1);
}
Ext.define('Ext.chart.theme.ColumnTheme', {
extend: 'Ext.chart.theme.Base',
constructor: function(config) {
this.callParent([Ext.apply({
colors: ['red','green']
}, config)]);
}
});
var chartb = new Ext.chart.Chart({
renderTo : Ext.getBody(),
theme:'ColumnTheme',
xtype: 'chart',
itemId:'demochart',
title: 'Sales Figures',
animate: true,
width : '80%',
height : '70%',
margin: '150 auto',
store: {
fields: days30fields,
data:
days30fieldValues
},
axes: [{
type: 'numeric',
position: 'left',
minimum: 0,
renderer: function (value) {
value = value / 1000000;
return value.toFixed(1);
},
title: 'Number of orders',
fields: days30fieldsd
}, {
type: 'category',
position: 'bottom',
title: 'Days',
fields: 'name',
}],
series: [{
highlight: true,
type: 'column',
//stacked: true,
xField: 'name',
yField: days30fieldsd,
style: { fill: 'blue' }
}]
});