Hi, I have been using the Jsci library (core and xtra)with my
program since Jsci version 0.911. Today, I have updated library to
version 0.914, then program crashes (graph line can not be drawn and
application is freezed.)
I wanted to use the method "setNumberFormat()" in the JLineGraph
class. but Jsci 0.911 does not support this. Does anyone has any
suggestions? I really appreciate if somebody could help me out here.
A part of my sorce code is showing bellow. This code can be
compiled, but does not behave correctly. Please point out the
problem.
regards,
Kaz
final float[] points = new float[data.length];
ValueType[] values = new ValueType[data.length];
for(int i=0; i<data.length; ++i) {
values[i] = ValueTypeFactory.getInstance(p, data[i]);
points[i] = values[i].getData()*1.0f;
if(p.getUnitCount()!=0) {
points[i] = points[i]/p.getUnitCount();
}
if(p.getUnit()==Parameter.UNIT_PERCENT) {
points[i] = points[i]*100;
}
}
mModel=new DefaultGraph2DModel();
mModel.setXAxis(0.0f,255.0f,points.length);
mModel.addSeries(points);
JLineGraph graph = new JLineGraph(mModel);
graph.setColor(0, LINE_COLOR);
setName(p.getSymbol());
setLayout(new JGraphLayout());
add(new JLabel("(Time)"), "X-axis");
//add(new JLabel(p.getSymbol() + " (" + p.getUnit()
+ ")"), "Y-axis");
JLabel symbolLabel = new JLabel(p.getSymbol());
JLabel unitLabel = new JLabel("("+ p.getUnit() +")");
symbolLabel.setFont(new Font("Default",Font.BOLD,15));
JPanel titlePanel = new JPanel();
titlePanel.add(symbolLabel);
titlePanel.add(unitLabel);
add(titlePanel,"Title");
//add(new JLabel("("+ p.getUnit() +")"),"Y-axis");
add(graph, "Graph");
setBackground(GRAPH_BACKGROUND_COLOR);