We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Background image

How can I assign an image as the background of a chart?

Backgrountimage property doesn't seem to work


    <SfChart Theme="Theme.Bootstrap5Dark" Background="transparent" BackgroundImage="~/images/Tormenta.jpg">
        <ChartArea BackgroundImage="~/images/Tormenta.jpg">
        <ChartAreaBorder Width="5" ></ChartAreaBorder>
        <ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.DateTime"></ChartPrimaryXAxis>
        <ChartSeriesCollection>
            <ChartSeries DataSource="realTimeData" XName="TimeLine" YName="Point" Type="Syncfusion.Blazor.Charts.ChartSeriesType.Line"></ChartSeries>
        </ChartSeriesCollection></ChartArea>
    </SfChart>




3 Replies

DG Durga Gopalakrishnan Syncfusion Team December 27, 2021 12:55 PM UTC

Hi Justo,


Greetings from Syncfusion.


We have ensured your reported scenario with attached snippet. Chart background is rendered properly as per behavior. We also have an online demo with background for chart. Please check with below screenshot and sample.


<SfChart BackgroundImage=https://img.freepik.com/free-photo/hand-painted-watercolor-background-with-sky-clouds-shape_24972-1095.jpg?size=626&ext=jpg>  

</SfChart>



Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/ChartBackImage1282608648.zip


Online Demo : https://blazor.syncfusion.com/demos/chart/tooltip-template?theme=bootstrap5


Please ensure whether you have specified the path properly. If you are still facing problem, please try to replicate an issue in above sample or share us issue reproduced sample so that it will be helpful to validate further.


Regards,

Durga G



JU Justo December 30, 2021 03:22 PM UTC

It works perfectly, thanks for the guide ..



DG Durga Gopalakrishnan Syncfusion Team December 31, 2021 05:17 AM UTC

Hi Justo,


Most welcome. Please get back to us if you need any further assistance. We are always happy in assisting you.


Regards,

Durga G


Loader.
Up arrow icon