简体   繁体   English

在后台向图表添加图像

[英]Adding an image to a chart in the background

consider the jsfiddle example http://jsfiddle.net/5D5eD/8/ . 考虑jsfiddle示例http://jsfiddle.net/5D5eD/8/ I want to add an image in the background which re-sizes itself with change in data values. 我想在背景中添加一个图像,该图像会随着数据值的变化而自行调整大小。 I was able to add the image in css which was static. 我能够在静态的css中添加图像。

body {background-image:url("image.jpg");}

I want to add the image but according to change in number of grids it also should scale more or less. 我想添加图像,但是根据网格数量的变化,它也应该或多或少地缩放。 How to add such an image ? 如何添加这样的图像?

Look at http://jsfiddle.net/5D5eD/17/ . 查看http://jsfiddle.net/5D5eD/17/ Try 尝试

.content+svg {
    background: url('http://www.google.cz/images/srpr/logo11w.png') center center no-repeat;
    background-size: contain;
}

Now the image resizes with the chart. 现在,图像将随着图表调整大小。

Additional and more customizable scaling based on chart data values would have to be done using JavaScript (jQuery). 基于图表数据值的其他且更可定制的缩放比例必须使用JavaScript(jQuery)来完成。 You need to specify how exactly you want the chart to behave to get more precise advice. 您需要指定您希望图表的行为如何以获取更精确的建议。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM