1 11 12 package org.eclipse.birt.chart.examples.api.script.java; 13 14 import org.eclipse.birt.chart.model.attribute.AxisType; 15 import org.eclipse.birt.chart.model.component.Axis; 16 import org.eclipse.birt.chart.model.component.Label; 17 import org.eclipse.birt.chart.script.ChartEventHandlerAdapter; 18 import org.eclipse.birt.chart.script.IChartScriptContext; 19 20 23 24 public class AxisScript extends ChartEventHandlerAdapter 25 { 26 33 public void beforeDrawAxisLabel( Axis axis, Label label, 34 IChartScriptContext icsc ) 35 { 36 if (axis.getType() == AxisType.TEXT_LITERAL) 37 { 38 label.getCaption( ).getColor( ).set( 140, 198, 62 ); 39 }else 40 { 41 label.getCaption().getColor( ).set( 208, 32, 0); 42 } 43 } 44 45 52 public void beforeDrawAxisTitle( Axis axis, Label label, 53 IChartScriptContext icsc ) 54 { 55 if (axis.getType() == AxisType.TEXT_LITERAL) 56 { 57 label.getCaption( ).getColor( ).set( 140, 198, 62 ); 58 }else 59 { 60 label.getCaption().getColor( ).set( 208, 32, 0); 61 } 62 } 63 } 64 | Popular Tags |