MOrris Example
Morris.Bar({
element: 'bar-example',
data: [
{ month: "2006", amount: 100},
{ month: "2007", amount: 75}
],
xkey: "month",
ykeys: ["amount"],
labels: ["amount"]
});
amount in ykeys and lables should be same as it is mentioned in Morris Example. Otherwise graph would not display because of error in amount format.
At moment my amount value is in this way
String amount = "[amount]";
amount="[amount]"
and i want value in this way
["amount"]
What would be easiest and preferred way to replace these values?
amountfirst using JSON.parse(), so you will get an array of strings, from where you can pick "amount" by using amountArray[0]