This discussion is archived
0 Replies Latest reply: Aug 23, 2012 8:20 AM by 931856 RSS

How to save a DTV Graph to file.

931856 Newbie
Currently Being Moderated
Hi

I'm trying to create a graph programmatically inside a bean and would like to save it to file

I'm doing something like

public UIGraph getGraph() {
m_graph = new UIGraph();
m_graph.setGraphType(GraphConstants.LINE_HORIZ_ABS);
m_graph.setTabularData(data);
return m_graph;
}

tabular data as

public List getTabularData()
{
ArrayList list = new ArrayList();
String] rowLabels = new String[ {"Boots", "Shoes"};
String] colLabels = new String[ {"2006", "2007", "2008"};
Double ] [ values = new Double][{
{120000, 122000, 175000},
{90000, 110000, 150000}
};
for (int c = 0; c < colLabels.length; c++)
{
for (int r = 0; r < rowLabels.length; r++)
{
list.add (new Object [] {colLabels[c], rowLabels[r],
new Double (values[r][c])});
}
}
return list;
}

what happening in this case is the .PNG file is getting created but showing "no data available".
Can anyone let me know where am I missing the link? or any work arround

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points