How can I dynamically generate x_axis tick mark? Currently, all examples are set tick mark of x-axis in JSP. Can we have a whole example for dynamically Chart generation? In the tutorial, I can find part code of that, but it seems the whole code missing.
Hello ,
Can you please provide more information about your scenario?
More code snippet before the adding of TickMark will be appreciated.
God Day
I have same problem, i try to add the tick mark on x axis, but i use the line :
xAxis.getChildren().add(mark);
this return me an error, at create the object in session, because getChildren method is undefined for the type Axis
Any help is appreciated. Thanks so much!
OJCarrillo
Hello Ramana,
Here is the code snippets to add dynamic tick marks to the chart axis.
..
Axis xAxis = new Axis();
xAxis.setType(AxisType.X.toString());
xAxis.setAutoRange(true);
xAxis.setAutoRangeSnap(true);
xAxis.setAutoTickMarks(false);
String month[] = {"JAN", "FEB","MAR","APR","MAY","JUN","JULY","AUG","SEPT","OCT","NOV","DEC"};
for(int i=0; i<month.length; ++i) {
TickMark mark= new TickMark();
mark.setValue(i);
mark.setTickCaption(month[i]);
}
xAxis.setAutoGridLines(true);
chart.getChildren().add(xAxis);
Hope it gives you idea to add the tick mark on chart axis.
Thank you
Roshan