This is a migrated thread and some comments may be shown as answers.

Annotations with DateTimeCategoricalAxis

1 Answer 55 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Alex
Top achievements
Rank 1
Alex asked on 13 May 2015, 04:54 PM

I am trying to add annotation to a chart with horizontal DateTimeCategoricalAxis by using this code, but it keeps crashing

1.CartesianCustomAnnotation annotation = new CartesianCustomAnnotation(chartView.getVerticalAxis(), chartView.getHorizontalAxis(), penaltyValue, penaltyMonth, "P");
2.chartView.getAnnotations().add(annotation);

I have tried making PenaltyValue a string, a Calendar, and a Date. It always crashes and logcat reports this error

java.lang.IllegalArgumentException: the value: Mon Feb 01 12:48:15 EST 2016 proved to be incompatible with its corresponding axis

How do I fix it.

1 Answer, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 15 May 2015, 10:17 AM
Hi Alexandar,

I answered your question about the same issue in the other thread you posted. In short, the penalty value should be of type double since it corresponds to your vertical axis which ,I assume, is a LinearAxis.

Regards,
Victor
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Chart
Asked by
Alex
Top achievements
Rank 1
Answers by
Victor
Telerik team
Share this question
or