|
How to align a table? |
Posted by Eva on Mar-23-2016 23:40 |
|
Hello Peter,
What is the best way to position the table such as the first "data" entry aligns with the left edge of the chart’s plot area (indicated by green circles)? The picture shows the desired output.
I tried the following:
1. Added the table at the point as follows (in Java)
x = chart.getPlotArea().getLeftX();
y = chart.getPlotArea().getBottomY();
table = chart.addTable(x, y, Chart.TopLef, nCols, nRow);
2. Filled the data...
3. Inserted the first column with labels using insertCol():
table.insertCol(0);
Unfortunately, once the column with labels is inserted, the inserted column aligns with the point. I was trying to follow the example "Data Table (2)", where the table with data was created first for the xAxis() and then the first column was inserted without disturbing the table. This doesn't work for me when I create a table with addTable() call.
What is the best way to achieve the desired alignment?
Thank you,
Eva
|
Re: How to align a table? |
Posted by Peter Kwan on Mar-24-2016 14:20 |
|
Hi Eva,
After you have entered everything into the table (so that the table can determine the first column width), you can move the table leftwards by the first column width.
table.setPos(x - table.getColWidth(0), y);
Hope this can help.
Regards
Peter Kwan |
Re: How to align a table? |
Posted by Eva on Mar-31-2016 04:09 |
|
Thank you, Peter! It worked perfectly.
Eva |
|