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

How to use a custom icon for Notes in charts

2 Answers 270 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 19 May 2016, 02:20 PM

Is there a way to use a custom icon (preferably from an icon font like Awseome Fonts) for the notes on a chart ?

 

Below the generic code we use for creating a note, so we would want to change the icon type to be a custom shape/icon/svg instead of one of the four predefined options of "square", "cross", ...

If that is not an option at all, any other way of how this can be achieved ? E.g. I've seen markers on maps can be customized for example.

Attached an example of how the notes currently look in the chart, having such a limited set of icon shapes does not really work for our use case.

var newNote = function (value, type, text, date, background) {
        var note = {
            value: value,
            color: '#606060',
            label: {
                text: text + ': ' + date,
                visible: false
            },
            icon: {
                type: type
            }
        };
        if (background) {
            note.icon.background = background;
        }
        return note;
    };

 

 

2 Answers, 1 is accepted

Sort by
0
Accepted
T. Tsonev
Telerik team
answered on 23 May 2016, 10:58 AM
Hello,


In your case you might be able to render the Font Awesome symbols directly in place (or as part of) the label template. See this snippet.

We allow overriding the rendering of the series notes using the Drawing API. See the reference on notes.visual.

I hope this helps.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Steve
Top achievements
Rank 1
answered on 31 May 2016, 02:10 PM

Thank you! The dojo snippet helped a lot in understanding how to use a font library to set a custom icon.

cheers,

Steve

Tags
Charts
Asked by
Steve
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Steve
Top achievements
Rank 1
Share this question
or