Bar Chart Example
Morris.Bar({
element: 'bar-example',
data: [
{ y: 'dddd', a: 100, b: 90 },
{ y: '2007', a: 75, b: 65 },
{ y: '2008', a: 50, b: 40 },
{ y: '2009', a: 75, b: 65 },
{ y: '2010', a: 50, b: 40 },
{ y: '2011', a: 75, b: 65 },
{ y: '2012', a: 100, b: 90 }
],
xkey: 'y',
ykeys: ['a', 'b'],
labels: ['Series A', 'Series B']
});
Area Chart Example
Morris.Area({
element: 'area-example',
data: [
{ y: 'dddd', a: 100, b: 90 },
{ y: '2007', a: 75, b: 65 },
{ y: '2008', a: 50, b: 40 },
{ y: '2009', a: 75, b: 65 },
{ y: '2010', a: 50, b: 40 },
{ y: '2011', a: 75, b: 65 },
{ y: '2012', a: 100, b: 90 }
],
xkey: 'y',
ykeys: ['a', 'b'],
labels: ['Series A', 'Series B']
});
In Morris Chart library Bar charts accepts strings for Y-AXIS but Area one doesn't.I can't understand why ?
THIS IS THE MORRIS LIBRARY
Morris.js is trying to parse x-values as timestamp. But 'dddd' has invalid format. You can skip date parsing by using parseTime: false
option (jsbin). In this case X values will be treated as an equally-spaced series.
See docs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With