I have this string
string[] xInBGraph = { "IVR", "Agents", "Abandoned", "Cancelled" };
and I have these values:
int ivr = 1;
int agents = 2;
int abandoned = 3;
int cancelled = 4;
What I need
To make an array for each element in the array xInBGraph in which the new array should contain one value and the other values are zero. For example This is how the final result will be
IVR = [ivr =1, 0 , 0 ,0, 0]
Agents = [0, agents=2, 0,0]
Abandoned = [0, 0, abandoned = 3, 0]
Cancelled = [0, 0, 0, cancelled = 0]
what I have tried
making 4 arrays and fill them in the correct data. It works good. However, my altimate goal is to transfer that final result to a json object. I need to return just on json object. but in my case, which is 4 arrays, I must return 4 json objects which is not good for my situation. I need to return just on json object. So, what is the object in c# that can have the mentioned data and can be transfer to one json object?
I am using json.net library so I can easily change any c# object to json object
Edit
I made these four arrays:
int[] ivrArray = { Tivr, 0, 0, 0};
int[] agentsArray = { 0, tTotalCallsByAgent, 0, 0 };
int[] abandonedArray = { 0, 0, tTotalAbandoned, 0};
int[] canceledArray = { 0, 0, 0, Tcancel};
Now all I need is something to save the label of each array and the array in one row.