Annotations with DateTimeCategoricalAxis

2 posts, 0 answers
  1. Alex
    Alex avatar
    54 posts
    Member since:
    Feb 2009

    Posted 13 May 2015 Link to this post

    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.

  2. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 15 May 2015 Link to this post

    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
  3. DevCraft banner
Back to Top