I’m trying to create a stacked barchart using flot. I have my data as
var data = [{
"data": [[1336979060, 0], [1339605620, 0], [1342232180, 0], [1344858740, 0], [1347485300, 0], [1350111860, 2]],
"label": "1 months"},
{
"data": [[1336979060, 0], [1339605620, 0], [1342232180, 0], [1344858740, 0], [1347485300, 0], [1350111860, 1]],
"label": "2 months"},
{
"data": [[1336979060, 0], [1339605620, 0], [1342232180, 0], [1344858740, 0], [1347485300, 0], [1350111860, 1]],
"label": "3 months"},
{
"data": [[1336979060, 0], [1339605620, 0], [1342232180, 0], [1344858740, 0], [1347485300, 0], [1350111860, 0]],
"label": "4 months"},
{
"data": [[1336979060, 0], [1339605620, 0], [1342232180, 0], [1344858740, 0], [1347485300, 0], [1350111860, 0]],
"label": "5 months"},
{
"data": [[1336979060, 0], [1339605620, 0], [1342232180, 0], [1344858740, 0], [1347485300, 0], [1350111860, 0]],
"label": "6 months"},
{
"data": [[1336979060, 0], [1339605620, 0], [1342232180, 0], [1344858740, 0], [1347485300, 0], [1350111860, 1]],
"label": "7 months"}];
I have created a fiddle to help you understand it better: http://jsfiddle.net/julijan/g2aJV/4/
You can see that it renders the labels correctly and it even renders the months correctly, which means it understands the data, but the bars are not showing.
Any ideas?
Thanks,
Julijan
To solve the problem make sure your x values are in the range of min-max you’ve defined. If you are using an unix timestamp make sure you multiply it by 1000 to convert seconds to milliseconds.