TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
-
Dmitry
- Newbie
![Newbie Newbie](./images/ranks/1star.gif)
- Posts: 54
- Joined: Mon Jul 27, 2009 12:00 am
-
Contact:
Post
by Dmitry » Fri Jul 31, 2009 12:31 pm
Code: Select all
chart.setLegendResolver(new LegendResolver() {
public Rectangle getBounds(Legend arg0, Rectangle rectangle) {
return rectangle;
}
public LegendItemCoordinates getItemCoordinates(Legend arg0, LegendItemCoordinates coordinates) {
return coordinates;
}
public String getItemText(Legend legend, LegendStyle legendStyle, int index, String text) {
String [] arr = text.split("??????"); //problem
return ShopTSMFunction.getStringSizeStorage(arr[0], "M")+arr[1];
}
});
What is delimiter between value and name?
Dmitry
-
Narcís
- Site Admin
![Site Admin Site Admin](./images/ranks/6stars.gif)
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Fri Jul 31, 2009 1:12 pm
Hi Dmitry,
Have you tried with a blank space character?
-
Dmitry
- Newbie
![Newbie Newbie](./images/ranks/1star.gif)
- Posts: 54
- Joined: Mon Jul 27, 2009 12:00 am
-
Contact:
Post
by Dmitry » Fri Jul 31, 2009 1:30 pm
with bank is not working too.
Code: Select all
public String getItemText(Legend legend, LegendStyle legendStyle, int index, String text) {
String [] arr = text.split("\\s+");// blank space character
return ShopTSMFunction.getStringSizeStorage(text, "M");
}
result arr[0] only - 832,563.18HSMNODE
8 56
3 51
2 50
, 44
5 53
6 54
3 51
. 46
1 49
8 56
6
H 72
S 83
M 77
N 78
O 79
D 68
E 69
-
Narcís
- Site Admin
![Site Admin Site Admin](./images/ranks/6stars.gif)
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Fri Jul 31, 2009 1:39 pm
Hi Demetrio,
You should debug getItemText and check text's format before splitting it. If the problem persists please attach a simple example project we can run "as-is" to reproduce the problem here.
Thanks in advance.
-
Dmitry
- Newbie
![Newbie Newbie](./images/ranks/1star.gif)
- Posts: 54
- Joined: Mon Jul 27, 2009 12:00 am
-
Contact:
Post
by Dmitry » Fri Jul 31, 2009 2:24 pm
I have done so
Code: Select all
public String getItemText(Legend legend, LegendStyle legendStyle, int index, String text) {
char sp = (char) 6;
String [] arr = text.split(Character.toString(sp));
String value = arr[0].replace(",", "");
return ShopTSMFunction.getStringSizeStorage(value, "M")+Character.toString(sp)+arr[1];
}
It's works