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

how to specify background image for plotarea of chart

2 Answers 556 Views
Charts
This is a migrated thread and some comments may be shown as answers.
ramesh
Top achievements
Rank 1
ramesh asked on 19 Mar 2012, 12:20 PM
In kendo chart i have to apply some gradient image for plot area.can any one help ?

2 Answers, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 22 Mar 2012, 09:48 AM
Hi Ramesh,

Basically, it is not possible to set an image as a background to the plotArea, but you could apply it to the <div id="chart">.
For example:
<div id="chart" style="background: center no-repeat url('someImage.png');"></div>

In addition, I believe our demos will be of help.

 

Kind regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
David
Top achievements
Rank 1
Iron
answered on 10 Oct 2024, 11:29 AM

Hi, I just found a solution that worked for me with a slight addition to the answer above.
For completeness, set the chart-area to transparant (or less transparent using color+opaque).
Tip: for a resizable image, set the resize styling.

For example:


<div id="chart" style="background-image: url('.....png');background-repeat: no-repeat;background-attachment: fixed;background-size: 100% 100%;">
</div>
<script>
$("#chart").kendoChart({
  chartArea: {
    background: "transparent", //or color
    opacity: 0.1 //or opacity
  },
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>  

Tags
Charts
Asked by
ramesh
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
David
Top achievements
Rank 1
Iron
Share this question
or