ijingshan / gwt-charts

Automatically exported from code.google.com/p/gwt-charts
0 stars 0 forks source link

Roles don't work #43

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am using LineChart and trying to use the data role to make some values 
uncertain.

I tried 2 thing, both won't work:

1. Define columns and data like this;
label: 'Year',  'Sales',    null, 'Expenses',     null
 STRING,   NUMBER, certainty,     number,  certainty
 '2004',   1000,     false,      400,      true
 '2005',   1170,      true,      460,      true
 '2006',    660,      true,     1120,      false
 '2007',   1030,      true,      540,      false

In this case I get an error message that all columns must be of the same type.

2. use dataTable.setProperty(row, column, "certainty", "false")
This does not give an error, but I don't get the expected dotted line.

I would be great to see an example on this..

Original issue reported on code.google.com by peter.n...@unclestock.com on 17 Oct 2013 at 8:30

GoogleCodeExporter commented 9 years ago
I meant: “All series on a given axis must be of the same data type”

Original comment by peter.n...@unclestock.com on 17 Oct 2013 at 9:18

GoogleCodeExporter commented 9 years ago
I got a little further.. 

When setting the role via 
DataColumn col = DataColumn.create(ColumnType.BOOLEAN);
col.setRole(RoleType.CERTAINTY);
dataTable.addColumn(col);

I get following error:
(Error) 
@com.googlecode.gwt.charts.client.DataTable::addColumn(Lcom/googlecode/gwt/chart
s/client/DataColumn;)([JavaScript object(110832)]): Invalid type: function() {
      var result = __static(dispId, this);
      if (result[0]) {
        throw result[1];
      } else {
        return result[1];
      }
    }.

Original comment by peter.n...@unclestock.com on 17 Oct 2013 at 10:32

GoogleCodeExporter commented 9 years ago
DataColumn in general doesn't seem to work.

DataTable dataTable = DataTable.create();

//fails:
DataColumn dataColumn = DataColumn.create(ColumnType.STRING);
dataColumn.setLabel("Year");
dataTable.addColumn(dataColumn);

//works:
dataTable.addColumn(ColumnType.STRING, "Year");

Original comment by alexfort...@gmail.com on 12 Feb 2014 at 9:09

GoogleCodeExporter commented 9 years ago
Concerning the javascript error reported above, when using the DataColumn class.
I have been able to work around the problem by changing the following method in 
the DataColumn class.

Original Code :

private final native void setType(String type) /*-{
        this.type = type.@com.googlecode.gwt.charts.client.ColumnType::getName();
    }-*/

Replaced code:
private final native void setType(String type) /*-{
        this.type = type;
    }-*/

Original comment by darren82...@gmail.com on 8 Aug 2014 at 9:23

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Cool, would be great to get this in the next build. I don't manage to rebuild 
the jar (I'm not used to Maven)

Original comment by peter.n...@unclestock.com on 8 Aug 2014 at 5:40

GoogleCodeExporter commented 9 years ago
Thanks for the patch!
Already commited and scheduled for the next release.

Original comment by rglafo...@gmail.com on 20 Aug 2014 at 4:19

GoogleCodeExporter commented 9 years ago

Original comment by rglafo...@gmail.com on 20 Aug 2014 at 4:20

GoogleCodeExporter commented 9 years ago
thanks for the patch.

this worked too: 

extend DataTable and add and use this method:

public final native int addCertaintyColumn()/*-{
     return this.addColumn({type:'boolean',role:'certainty'});
     }-*
/;

see 
http://stackoverflow.com/questions/11979871/gwt-chart-api-googlecode-how-to-set-
roletype-to-a-column-of-a-datatable

Original comment by peter.n...@unclestock.com on 26 Aug 2014 at 11:29

GoogleCodeExporter commented 9 years ago

Original comment by rglafo...@gmail.com on 3 Sep 2014 at 11:07