jtpAnalisys.addTab("Account review", jspSpent);
stNew.setData(strGroups, dblMonthSpent, strDates);
//then as a plot
JScrollPane jspChart=new JScrollPane(new MultipleChart(strGroups, dblMonthSpent, strDates, "Spent"));
jtpAnalisys.addTab("Expenses by months", jspChart);
//jtpAnalisys.setToolTipTextAt(1, "Outcome by months");
//percent of money spent to different groups in months tab 3
//dblMonthSpent[group number][month number]
double[] dblMonthTotal=new double[dblMonthSpent[0].length]; //the total amount of spend money per month
for(int x=0; x<dblMonthTotal.length; x++)
{
dblMonthTotal[x]=0;
for(int y=0; y<dblMonthSpent.length; y++)
{
if(dblMonthSpent[y][x]>0)
dblMonthTotal[x]+=dblMonthSpent[y][x];
}
}
for(int i=0; i<dblMonthSpent.length; i++)
for(int k=0; k<dblMonthSpent[i].length; k++)
{
if(dblMonthSpent[i][k]<0)
dblMonthSpent[i][k]=0;
if(dblMonthTotal[k]!=0)
dblMonthSpent[i][k]=dblMonthSpent[i][k]*100/dblMonthTotal[k];
}
dblMonthTotal=null;
MultipleChart mtcPercents=new MultipleChart(strGroups, dblMonthSpent, strDates, "Spent %");
mtcPercents.setMaxValue(100);
jspChart=new JScrollPane(mtcPercents);
jtpAnalisys.addTab("Expenses by months in percent", jspChart);
//jtpAnalisys.setToolTipTextAt(2, "Outcome by monthsin percent");
//amount of money on different credit/debit cards at different months tab 3
jspChart=new JScrollPane(new MultipleChart(strCardNames, dblCardRemainings, strDates, "Balance"));
jtpAnalisys.addTab("Card balances", jspChart);
//jtpAnalisys.setToolTipTextAt(3, "Card balances");
}