hello,
I need move some labels on bottom axis above the axis line and some labels should stay below. But i didnt found solution, please help.
Or is there some handler for drawing series? because in monotouch-teechart-lib. i found handler but not in java lib.
Same problem with series Marks, i want set different arrow length for each mark in series .
Thanks.
android axis labels change position (move up)
Re: android axis labels change position (move up)
Hi,
http://www.teechart.net/support/viewtop ... 69&p=42391
What event did you use in TeeChart MonoTouch (now TeeChart .NET for Xamarin.iOS)?NIS wrote:I need move some labels on bottom axis above the axis line and some labels should stay below. But i didnt found solution, please help.
Or is there some handler for drawing series? because in monotouch-teechart-lib. i found handler but not in java lib.
Have you tried doing something similar to this?NIS wrote:Same problem with series Marks, i want set different arrow length for each mark in series .
http://www.teechart.net/support/viewtop ... 69&p=42391
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: android axis labels change position (move up)
monotouch solution:
chart.Axes.Bottom.GetAxisDrawLabel += new Steema.TeeChart.GetAxisDrawLabelEventHandler(Bottom_GetAxisDrawLabel);
int count = 0;
void Bottom_GetAxisDrawLabel (object sender, Steema.TeeChart.GetAxisDrawLabelEventArgs e)
{
if ( values [count] > 0.0) {
e.Y = (int)(chart4.Axes.Left.CalcYPosValue(0.0)-8);
}else if ( values [count] < 0.0 || values [count] == 0.0) {
e.Y = (int)(chart4.Axes.Left.CalcYPosValue(0.0)-21);
}
count++;
if(count == values.Count) count = 0;
}
chart.Axes.Bottom.GetAxisDrawLabel += new Steema.TeeChart.GetAxisDrawLabelEventHandler(Bottom_GetAxisDrawLabel);
int count = 0;
void Bottom_GetAxisDrawLabel (object sender, Steema.TeeChart.GetAxisDrawLabelEventArgs e)
{
if ( values [count] > 0.0) {
e.Y = (int)(chart4.Axes.Left.CalcYPosValue(0.0)-8);
}else if ( values [count] < 0.0 || values [count] == 0.0) {
e.Y = (int)(chart4.Axes.Left.CalcYPosValue(0.0)-21);
}
count++;
if(count == values.Count) count = 0;
}
Re: android axis labels change position (move up)
So,
thanks for your help, you solved my problem with marks.
And there is reason why i need move Label over the axis line.
thanks for your help, you solved my problem with marks.
And there is reason why i need move Label over the axis line.
Re: android axis labels change position (move up)
(picture is in post over)
and i noticed that one more small problem is with ticks:
chart.getAxes().getBottom().getTicks().setLength(0);
chart.getAxes().getBottom().getTicks().setColor(Color.white);
chart.getAxes().getBottom().getTicks().setUsesVisible(false);
chart.getAxes().getBottom().getTicks().setVisible(false);
chart.getAxes().getBottom().getTicksInner().setLength(0);
chart.getAxes().getBottom().getTicksInner().setColor(Color.white);
chart.getAxes().getBottom().getTicksInner().setUsesVisible(false);
chart.getAxes().getBottom().getTicksInner().setVisible(false);
-> nothink works
(
but maybe problem can be that i have added into custom labels:
chart.getAxes().getBottom().getCustomLabels().add( 0.0, "12/12" );
)
and i noticed that one more small problem is with ticks:
chart.getAxes().getBottom().getTicks().setLength(0);
chart.getAxes().getBottom().getTicks().setColor(Color.white);
chart.getAxes().getBottom().getTicks().setUsesVisible(false);
chart.getAxes().getBottom().getTicks().setVisible(false);
chart.getAxes().getBottom().getTicksInner().setLength(0);
chart.getAxes().getBottom().getTicksInner().setColor(Color.white);
chart.getAxes().getBottom().getTicksInner().setUsesVisible(false);
chart.getAxes().getBottom().getTicksInner().setVisible(false);
-> nothink works
(
but maybe problem can be that i have added into custom labels:
chart.getAxes().getBottom().getCustomLabels().add( 0.0, "12/12" );
)
Re: android axis labels change position (move up)
Hi,
The only way I can think to work around this is to hide those labels that correspond to negative values with the AxisLabelResolver. And you could use the same event to manually draw the labels where you want.
Something like this:
The only way I can think to work around this is to hide those labels that correspond to negative values with the AxisLabelResolver. And you could use the same event to manually draw the labels where you want.
Something like this:
Code: Select all
tChart1.setAxisLabelResolver(new AxisLabelAdapter() {
@Override
public String getLabel(Axis axis, ISeries s, int valueIndex, String labelText) {
if (axis == tChart1.getAxes().getBottom()) {
if (valueIndex == -1) {
for (valueIndex=0; valueIndex<tChart1.getSeries(0).getCount(); valueIndex++) {
if (tChart1.getSeries(0).getXValues().getValue(valueIndex) == Double.parseDouble(labelText)) {
if (tChart1.getSeries(0).getYValues().getValue(valueIndex) < 0) {
int x = axis.calcPosValue(tChart1.getSeries(0).getXValues().getValue(valueIndex)) - (tChart1.getGraphics3D().textWidth(labelText) / 2);
int y = tChart1.getChart().getChartRect().getBottom() - 15;
tChart1.getGraphics3D().textOut(x, y, labelText);
return "";
}
}
}
}
}
return labelText;
}
});
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |