How can i add an image as background in Chartjs? - background

I am using chart.js lib on a programmable device i need to add an image as background to my chart, if that is not possible how can i change background color to black?. I cannot use Jquery as it is not supported by the Platform.
Thank you

Thank you!
I didn't think to CSS, i added an image too in a similar way
canvas {
background-image: url(backgroundimage.jpg);
}

You can style the canvas element. Something like this will work
canvas {
background-color: black;
}
Fiddle - https://jsfiddle.net/w1yhp03h/

Related

Apexcharts crosshair tooltip

I am using Apexcharts with the vue wrapper in my application, There is nothing in the documentation that allows me to edit the tool-tips on the cross-hairs. I would like to edit how it looks as the white box is not working with the design of the page. any help would be much appreciated. thank you
You can use CSS to customize the X-axis tooltip appearance.
.apexcharts-xaxistooltip {
background: #1B213B;
color: #fff;
}
Currently, there is no option to set x-axis tooltip colors in JS. Might be provided in the next releases.

Python module Pisa: how change background color for all page?

How i can change background color of all page?
like this :
body,div { background-color:#f4f4f4; }
Now background changes only for div with information, remaining page have white color. if it is possible, can you write example?
P.s. How i can draw border around ?
Acording to the documentacion https://github.com/chrisglass/xhtml2pdf/blob/master/doc/usage.rst#supported-page-properties-and-values #page only accept few css propierties:
background-image
size
margin, margin-bottom, margin-left, margin-right, margin-top
So maybe the easyest is to make a jpg to draw the background with background color and border. And use that image in background-image propierty:
#page {background-image: url('local_path/to/your/image.jpg')}
I hope this will help you
html,body{height:100%}
body,div { background-color:#f4f4f4; }
and your Second Question > How i can draw border around ?
add
border:1px #ccc solid

Background image on :hover does'nt show

I'm trying to apply a background image on a menu li on a :hover, however, it doesn't seem to recognize/show the image. It does respond to a color as background on the hover, which is in the same background line in the CSS.
I've made a jsfiddle with the code narrowed down to basics:
Obviously the image wouldn't show in this Fiddle, i'm using a local image.
As you can see, it does respond to the background colors, but not to the images.
Where am I going wrong here?
this works:
.logo li:hover
{
background:navy url('http://upload.wikimedia.org/wikipedia/commons/5/51/Google.png');
display: inline-block;
}
your doesnt work because you are setting
background-image:url('paper.gif');
and then you do this:
background: navy;
this way you are reseting the background canceling previous values
see updated fiddle
http://jsfiddle.net/YgxmU/
You did small mistake following will give your result
background: navy url('paper.gif');
Your mistake is you have given as
background-image:url('paper.gif');
background: navy;
the background property override the background-image:url('paper.gif');

Fullscreen slideshow with vertical carousel.Fading in of fullscreen image issue

I made a vertical carousel which consists of images that when clicked should be visible fullscreen. But the problem is i'm not able to figure out how to make sure the fullscreen images are preloaded or something and works like the thumbnail images(getting preloaded).
I'm not sure what approach to follow for preloading the fullscreen images using css background and how to make sure the images fadeIn or just some transition when i click on the thumbnail in the carousel.
Please have a look at the following link where my code is uploaded.
http://www.lluvia.me/slideshow/carousel.html
If its convenient,feel free to check the script by checking the source.
Help would be appreciated. Thanks!
Found this post and figured it might help you, Preloading images with jQuery
Try and post some of the code in your body for future reference. :)
Quick and easy:
function preload(arrayOfImages) {
$(arrayOfImages).each(function(){
$('<img/>')[0].src = this;
// Alternatively you could use:
// (new Image()).src = this;
});
}
// Usage:
preload([
'img/imageName.jpg',
'img/anotherOne.jpg',
'img/blahblahblah.jpg'
]);
Or, if you want a jQuery plugin:
$.fn.preload = function() {
this.each(function(){
$('<img/>')[0].src = this;
});
}
// Usage:
$(['img1.jpg','img2.jpg','img3.jpg']).preload();
Alternatively, if you want to stick purely with CSS check out this page: http://perishablepress.com/3-ways-preload-images-css-javascript-ajax/ You can just have the background image be positioned off screen then come on screen when needed.
#preload-01 { background: url(http://domain.tld/image-01.png) no-repeat -9999px -9999px; }
#preload-02 { background: url(http://domain.tld/image-02.png) no-repeat -9999px -9999px; }
#preload-03 { background: url(http://domain.tld/image-03.png) no-repeat -9999px -9999px; }

Is there an easier way to display/create rollover images than batching in Photoshop/Fireworks?

Is there an easier way to display/create rollover images than batching in Photoshop/Fireworks?
Ideally this would be done through CSS or Javascript, somehow creating a semi-transparent white layer over an image when moused over. Currently I just have Photoshop process images with +10% brightness, and do the rest in Dreamweaver with find/replace.
It'd be nice not to have to create separate rollover images for each picture. Thanks!
Using css, you can use something like this:
#navigation a {
background:url(image.png) no-repeat;
filter:alpha(opacity=100);
opacity: 1 }
#navigation a:hover {
filter:alpha(opacity=80);
opacity: 0.8 }
More info here
With images you don't always have to create a new image for rollovers, you can edit the CSS to decrease the opacity of the element:
.myElement
{
background.image: url(path/to/file/image.png);
}
.myElement:hover
{
filter:alpha(opacity=50);
-moz-opacity:0.5;
-khtml-opacity: 0.5;
opacity: 0.5;
}
Also I think you'd benefit from looking into CSS Sprites:
CSS-tricks sprites tuorial
A list apart's CSS sprites
Css sprites.com generator