Cant See the chart [message #148057] |
Sun, 26 March 2006 15:50 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: tarkeshwar26.yahoo.co.in
hi,
i have compiled the programm sucess fully and it is executed sucessfully
but i cantt see the chart. where is it and it is giving warning that no
plugins are defined in *BIRT_HOME e:\chart_lin\* e:\chart_lib is the
classpath for the required jars. in the faq there is that set the system
property to standalone or start the jvm using -DSTANDALONE what is this i
can understand please help.
the codes are
************************************************************ ********************
import org.eclipse.birt.chart.model.*;
import org.eclipse.birt.chart.model.component.*;
import org.eclipse.birt.chart.render.*;
import org.eclipse.birt.chart.model.component.impl.*;
import org.eclipse.birt.chart.model.attribute.LegendItemType.*;
import org.eclipse.birt.chart.model.layout.*;
import org.eclipse.birt.chart.model.type.*;
import org.eclipse.birt.chart.model.type.impl.*;
import org.eclipse.birt.chart.model.attribute.*;
import org.eclipse.birt.chart.model.attribute.impl.*;
import org.eclipse.birt.chart.model.impl.*;
import org.eclipse.birt.chart.model.data.*;
import org.eclipse.birt.chart.model.data.impl.*;
import org.eclipse.birt.chart.model.type.impl.LineSeriesImpl.*;
import org.eclipse.birt.chart.model.attribute.Fill.*;
public class Chartt{
public static void main(String[]args){
System.setProperty("STANDALONE", "C:/Chart_lib/") ;
ChartWithAxes cwaEmpty = ChartWithAxesImpl.create();
cwaEmpty.getTitle().getLabel().getCaption().setValue("Hello Chart");
ChartWithAxes cwaBar = ChartWithAxesImpl.create();
cwaBar.getBlock().setBackground(ColorDefinitionImpl.WHITE()) ;
Plot p = cwaBar.getPlot();
p.getClientArea().setBackground(
ColorDefinitionImpl.create(255, 255, 225));
cwaBar.getTitle().getLabel().getCaption().
setValue("Sample Line Chart");
Legend lg = cwaBar.getLegend();
LineAttributes lia = lg.getOutline();
lg.getText().getFont().setSize(16);
lia.setStyle(LineStyle.SOLID_LITERAL);
lg.getInsets().set(10, 5, 0, 0);
lg.getOutline().setVisible(false);
lg.setAnchor(Anchor.NORTH_LITERAL);
Axis xAxisPrimary = cwaBar.getPrimaryBaseAxes()[0];
xAxisPrimary.setType(AxisType.TEXT_LITERAL);
xAxisPrimary.getMajorGrid().setTickStyle(TickStyle.BELOW_LIT ERAL);
xAxisPrimary.getOrigin().setType(IntersectionType.VALUE_LITE RAL);
xAxisPrimary.getTitle().setVisible(false);
Axis yAxisPrimary = cwaBar.getPrimaryOrthogonalAxis(xAxisPrimary);
yAxisPrimary.getMajorGrid().setTickStyle(TickStyle.LEFT_LITE RAL);
yAxisPrimary.setPercent(true);
/*Vector vs = new Vector();
vs.add("one");
vs.add("two");
vs.add("three");
ArrayList vn1 = new ArrayList();
vn1.add(new Double(25));
vn1.add(new Double(35));
vn1.add(new Double(-45));
TextDataSet categoryValues = TextDataSetImpl.create(vs);
NumberDataSet orthoValues1 = NumberDataSetImpl.create(vn1);
// CREATE THE CATEGORY SERIES
Series seCategory = SeriesImpl.create();
seCategory.setDataSet(categoryValues);
*/
// CREATE THE PRIMARY DATASET
LineSeries ls = (LineSeries) LineSeriesImpl.create();
ls.setSeriesIdentifier("My Line Series");
// ls.setDataSet(orthoValues1);
ls.getLineAttributes().setColor(ColorDefinitionImpl.CREAM()) ;
ls.getMarker().setType(MarkerType.TRIANGLE_LITERAL);
ls.getLabel().setVisible(true);
SeriesDefinition sdX = SeriesDefinitionImpl.create();
sdX.getSeriesPalette().update(0); // SET THE COLORS IN THE PALETTE
xAxisPrimary.getSeriesDefinitions().add(sdX);
SeriesDefinition sdY = SeriesDefinitionImpl.create();
sdY.getSeriesPalette().update(1); // SET THE COLORS IN THE PALETTE
yAxisPrimary.getSeriesDefinitions().add(sdY);
//sdX.getSeries().add(seCategory);
sdY.getSeries().add(ls);
System.out.println("Executed Sucessfully");
}
}
************************************************************ *******************
Error is:
E:\JavaPrograms\chart>javac Chartt.java
Note: Chartt.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
E:\JavaPrograms\chart>java Chartt
Mar 26, 2006 8:58:07 PM
org.eclipse.birt.core.framework.server.ServerPlatform <
nit>
WARNING: No plugins in BIRT_HOME: /e:/Chart_lib/, make sure this directory
is c
rrect!
E:\JavaPrograms\chart>javac -Xlint:unchecked Chartt.java
Chartt.java:76: warning: [unchecked] unchecked call to add(E) as a member
of th
raw type org.eclipse.emf.common.util.EList
xAxisPrimary.getSeriesDefinitions().add(sdX);
^
Chartt.java:80: warning: [unchecked] unchecked call to add(E) as a member
of th
raw type org.eclipse.emf.common.util.EList
yAxisPrimary.getSeriesDefinitions().add(sdY);
^
Chartt.java:82: warning: [unchecked] unchecked call to add(E) as a member
of th
raw type org.eclipse.emf.common.util.EList
sdY.getSeries().add(ls);
^
3 warnings
E:\JavaPrograms\chart>java Chartt
E:\JavaPrograms\chart>javac Chartt.java
Note: Chartt.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
E:\JavaPrograms\chart>java Chartt
Executed Sucessfully
E:\JavaPrograms\chart>
************************************************************ ***************
Please Help
|
|
|
Re: Cant See the chart [message #148950 is a reply to message #148057] |
Tue, 28 March 2006 13:41 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
David Michonneau![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=dmichonneau%40actuate.com) Messages: 1145 Registered: July 2009 |
Senior Member |
|
|
If you don't use SVG or other BIRT plugin, you don't have to specify
BIRT_HOME. In fact if you set Standalone, you shouldn't set BIRT_HOME. If
you set BIRT_HOME it should point to the folder containing the "plugins"
directory, which itself contains the plugins.
Thanks,
David
"Tarkeshwar" <tarkeshwar26@yahoo.co.in> wrote in message
news:eab6bc1fa03f06e37db469cc70643cdd$1@www.eclipse.org...
> hi,
> i have compiled the programm sucess fully and it is executed sucessfully
> but i cantt see the chart. where is it and it is giving warning that no
> plugins are defined in *BIRT_HOME e:\chart_lin\* e:\chart_lib is the
> classpath for the required jars. in the faq there is that set the system
> property to standalone or start the jvm using -DSTANDALONE what is this i
> can understand please help.
> the codes are
> ************************************************************ ********************
>
> import org.eclipse.birt.chart.model.*;
> import org.eclipse.birt.chart.model.component.*;
> import org.eclipse.birt.chart.render.*;
> import org.eclipse.birt.chart.model.component.impl.*;
> import org.eclipse.birt.chart.model.attribute.LegendItemType.*;
> import org.eclipse.birt.chart.model.layout.*;
> import org.eclipse.birt.chart.model.type.*;
> import org.eclipse.birt.chart.model.type.impl.*;
> import org.eclipse.birt.chart.model.attribute.*;
> import org.eclipse.birt.chart.model.attribute.impl.*;
> import org.eclipse.birt.chart.model.impl.*;
> import org.eclipse.birt.chart.model.data.*;
> import org.eclipse.birt.chart.model.data.impl.*;
> import org.eclipse.birt.chart.model.type.impl.LineSeriesImpl.*;
> import org.eclipse.birt.chart.model.attribute.Fill.*;
>
> public class Chartt{
> public static void main(String[]args){
> System.setProperty("STANDALONE", "C:/Chart_lib/") ;
> ChartWithAxes cwaEmpty = ChartWithAxesImpl.create();
> cwaEmpty.getTitle().getLabel().getCaption().setValue("Hello Chart");
> ChartWithAxes cwaBar = ChartWithAxesImpl.create();
> cwaBar.getBlock().setBackground(ColorDefinitionImpl.WHITE()) ;
> Plot p = cwaBar.getPlot();
> p.getClientArea().setBackground(
> ColorDefinitionImpl.create(255, 255, 225));
> cwaBar.getTitle().getLabel().getCaption().
> setValue("Sample Line Chart");
>
> Legend lg = cwaBar.getLegend();
> LineAttributes lia = lg.getOutline();
> lg.getText().getFont().setSize(16);
> lia.setStyle(LineStyle.SOLID_LITERAL);
> lg.getInsets().set(10, 5, 0, 0);
> lg.getOutline().setVisible(false);
> lg.setAnchor(Anchor.NORTH_LITERAL);
>
> Axis xAxisPrimary = cwaBar.getPrimaryBaseAxes()[0];
> xAxisPrimary.setType(AxisType.TEXT_LITERAL);
> xAxisPrimary.getMajorGrid().setTickStyle(TickStyle.BELOW_LIT ERAL);
> xAxisPrimary.getOrigin().setType(IntersectionType.VALUE_LITE RAL);
> xAxisPrimary.getTitle().setVisible(false);
>
> Axis yAxisPrimary = cwaBar.getPrimaryOrthogonalAxis(xAxisPrimary);
> yAxisPrimary.getMajorGrid().setTickStyle(TickStyle.LEFT_LITE RAL);
> yAxisPrimary.setPercent(true);
>
> /*Vector vs = new Vector();
> vs.add("one");
> vs.add("two");
> vs.add("three");
>
> ArrayList vn1 = new ArrayList();
> vn1.add(new Double(25));
> vn1.add(new Double(35));
> vn1.add(new Double(-45));
>
> TextDataSet categoryValues = TextDataSetImpl.create(vs);
> NumberDataSet orthoValues1 = NumberDataSetImpl.create(vn1);
>
> // CREATE THE CATEGORY SERIES
> Series seCategory = SeriesImpl.create();
> seCategory.setDataSet(categoryValues);
> */
> // CREATE THE PRIMARY DATASET
> LineSeries ls = (LineSeries) LineSeriesImpl.create();
> ls.setSeriesIdentifier("My Line Series");
> // ls.setDataSet(orthoValues1);
> ls.getLineAttributes().setColor(ColorDefinitionImpl.CREAM()) ;
> ls.getMarker().setType(MarkerType.TRIANGLE_LITERAL);
> ls.getLabel().setVisible(true);
>
> SeriesDefinition sdX = SeriesDefinitionImpl.create();
> sdX.getSeriesPalette().update(0); // SET THE COLORS IN THE PALETTE
> xAxisPrimary.getSeriesDefinitions().add(sdX);
>
> SeriesDefinition sdY = SeriesDefinitionImpl.create();
> sdY.getSeriesPalette().update(1); // SET THE COLORS IN THE PALETTE
> yAxisPrimary.getSeriesDefinitions().add(sdY);
> //sdX.getSeries().add(seCategory);
> sdY.getSeries().add(ls);
> System.out.println("Executed Sucessfully");
> }
> }
> ************************************************************ *******************
> Error is:
> E:\JavaPrograms\chart>javac Chartt.java
> Note: Chartt.java uses unchecked or unsafe operations.
> Note: Recompile with -Xlint:unchecked for details.
>
> E:\JavaPrograms\chart>java Chartt
> Mar 26, 2006 8:58:07 PM
> org.eclipse.birt.core.framework.server.ServerPlatform <
> nit>
> WARNING: No plugins in BIRT_HOME: /e:/Chart_lib/, make sure this directory
> is c
> rrect!
>
> E:\JavaPrograms\chart>javac -Xlint:unchecked Chartt.java
> Chartt.java:76: warning: [unchecked] unchecked call to add(E) as a member
> of th
> raw type org.eclipse.emf.common.util.EList
> xAxisPrimary.getSeriesDefinitions().add(sdX);
> ^
> Chartt.java:80: warning: [unchecked] unchecked call to add(E) as a member
> of th
> raw type org.eclipse.emf.common.util.EList
> yAxisPrimary.getSeriesDefinitions().add(sdY);
> ^
> Chartt.java:82: warning: [unchecked] unchecked call to add(E) as a member
> of th
> raw type org.eclipse.emf.common.util.EList
> sdY.getSeries().add(ls);
> ^
> 3 warnings
>
> E:\JavaPrograms\chart>java Chartt
>
> E:\JavaPrograms\chart>javac Chartt.java
> Note: Chartt.java uses unchecked or unsafe operations.
> Note: Recompile with -Xlint:unchecked for details.
>
> E:\JavaPrograms\chart>java Chartt
> Executed Sucessfully
>
> E:\JavaPrograms\chart>
> ************************************************************ ***************
> Please Help
>
|
|
|
Powered by
FUDForum. Page generated in 0.03462 seconds