Jump to content
We've recently updated our Privacy Statement, available here ×

Logarthmic scale


plozachm

Recommended Posts

Hi again,

 

I have another question... I am trying to use a logarithmic scale for a chart. I succeed in using it (have a look on valueExpression):

 

 

Code:
<categorySeries>
<seriesExpression>
<![CDATA[$F{mes} + "-" + $F{year}]]>
</seriesExpression>
<categoryExpression>
<![CDATA[( $F{cdmcategory}.equals( new String("-unknown-"«») ) ? "Sin categoría" : $F{cdmcategory} )]]>
</categoryExpression>
<valueExpression>
<![CDATA[( $F{tickets}.intValue()==0 ? new Double(0) : new Double (Math.log($F{tickets}.doubleValue())/Math.log(1.1)) )]]>
</valueExpression>

 

But my problem is I would like to display real values on the X axis (with this solution it displays the logarithmic values).

 

I tried to use a customizer:

 

public void customize(org.jfree.chart.JFreeChart chart,

JRChart jasperChart){

CategoryDataset myPlot = ((Object) chart.getCategoryPlot()).getDateRange();

String temp = String.valueOf(myPlot.getColumnKeys().get(1));

chart.setTitle(temp);

}

 

I can change some stuff (Here I set the title to the value of the first category, not very useful but I was just testing...) of the chart but I have no access to the X axis labels.

 

Some ideas?

 

Thanks a lot in advance...

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...