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

Show custom images with ScatterLineSeries

3 Answers 103 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Auvo
Top achievements
Rank 1
Auvo asked on 08 Sep 2016, 05:26 PM

Hi

is it possible to show custom images / image files in the chart, over the scatterlineseries?

 

If possible, could you provide some examples

 

Regards,

Auvo

 

3 Answers, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 13 Sep 2016, 02:58 PM
Hi Auvo,

I am not quite sure whether I understand the exact scenario you want to achieve properly.

If you want to set a background image to the whole chart, you can do it by setting such to its element like follows:
div.RadHtmlChart {
    background-image: url("image.jpg");
}

In case you want to add custom image to the markers of the ScatterLine series, you can achieve it by utilizing the RadHtmlChart's markers Visual functionality like demonstrated here:
http://demos.telerik.com/kendo-ui/line-charts/visuals

In a RadHtmlChart scenario, the configuration should be similar to:
<telerik:RadHtmlChart runat="server" ID="ScatterChart1" Width="800px">
    <PlotArea>
        <Series>
            <telerik:ScatterSeries Name="Applicance 1">
                <MarkersAppearance Visual="markersVisual" Size="30" />
                <SeriesItems>
                    <telerik:ScatterSeriesItem X="82" Y="15" />
                    <telerik:ScatterSeriesItem X="79" Y="13" />
                    <telerik:ScatterSeriesItem X="77" Y="10" />
                    <telerik:ScatterSeriesItem X="74" Y="7" />
                </SeriesItems>
            </telerik:ScatterSeries>
        </Series>
    </PlotArea>
</telerik:RadHtmlChart>
<script>
    function markersVisual(e) {
        var src = "./icons/sampleIcon.png";
        var image = new kendo.drawing.Image(src, e.rect);
        return image;
    }
</script>

I hope this helps.

Regards,
Vessy
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Jayaraman
Top achievements
Rank 1
answered on 19 Sep 2016, 12:02 PM

Hi, We have a similar requirement. But can not use Kendo. Need to display an image from a set of a few images (max 20) based on Y Value range? Is it possible to do without using Kendo, by customising Label. If so could you give an example?

 

Thanks,

Jay

0
Vessy
Telerik team
answered on 22 Sep 2016, 08:51 PM
Hi Jayaraman,

RadHtmlChart for ASP.NET AJAX is a serer-side wrapper for the kendo UI widget, this is why you can use the Kendo UI chart API without referencing any additional scripts. Currently the desired by you functionality can be achieved only client-side, in the way demonstrated in my previous reply.

Regards,
Vessy
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Chart (HTML5)
Asked by
Auvo
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Jayaraman
Top achievements
Rank 1
Share this question
or