mahmud-hasan / ofcgwt

Automatically exported from code.google.com/p/ofcgwt
0 stars 0 forks source link

YAxis on right side are not null checked when using getYAxisRight() #67

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Problem:
1. getYAxis() method in Class ChartData are not null-checked 

Situation:
ofcgwt version : version2.1 on Windows XP sp3

 I was trying to use YAxis like below:
    ChartData cd = new ChartData(...);
    YAxis yaR = cd.getYAixsRight();
    yaR.set....

   it turns out yaR Object is null ..

 I checked the source file and I found out getYAxisRight() are not using
null-checking like getYAxis() and getXAxis()....
  public YAxis getYAxisRight(){
    return y_axis_right;
  }

other axis like getYAxis() are like:
  public YAxis getYAxis(){
    if(y_axis == null ) y_axis = new YAxis();
    return y_axis;
  }

 Is there any thing I'm missing , or the YAxis on the right side are designed to be unchecked ? or anything else????
 Notify me if anything wasn't described clearly...thanks

gTalk: silunchn@gmail.com

Original issue reported on code.google.com by silun...@gmail.com on 24 Dec 2010 at 3:16

GoogleCodeExporter commented 9 years ago
In JSON format
Please tell me the exact "Name - Value" pair for assinging a data line to 
Y-Right axis

Original comment by chidambar.181@gmail.com on 25 Dec 2010 at 11:05

GoogleCodeExporter commented 9 years ago
eh....

I'm not assure about the data-line assigning to the Y-Right Axis , neither....

I was just trying to re-fix the Y-Right axis ... 
My exact code was here below: 
=======================================================
    ChartData _cd = new ChartData();
    ...
    ...//Code nothing to do with Y-Right Axis
    ...
    YAxis yaR = _cd.getYAxisRight();
    long max_yaR = yaR.getMax().longValue();//where it throws a NullPointerException..
=======================================================

    the ChartData Object "_cd" I'm using may not init Y-Right axis sometimes .. so ..when I trying to getYAxisRight() ,  the null Y-Right axis throws Exception...
    And the source code found  in ofcgwt2.1.jar are like below :
****************************************
       public YAxis getYAxisRight(){
          return y_axis_right;
       }
****************************************

    My  Question is :
*********************
        Why method "getYAxisRight()" in "ChartData.java" are not null-check like method "getXAxis()" or "getYAxis()"....???
*********************

Original comment by silun...@gmail.com on 25 Dec 2010 at 2:03