Remove kendo Area chart padding - twitter-bootstrap-3

There is some default padding in areachart.
I tried my best to force it make 0 padding, but no luck.
Any idea how areachart touches the edges of the box
( base css framework is bootstrap3 ).
after using ( as #suraj suggestion in comments )

Try specifying the padding inside the chart initialization. Something like this:
$("#chart").kendoChart({
//....
chartArea: {
margin: 0,
padding:0
},
plotArea: { margin: 0, padding:0 }
});

Related

React Native: Radial Gradient Background

Is there an package, or another way to have a simple, let's say blue to blueish, radial gradient background, for one of the views?
I've tried react-native-radial-gradient, but it seems like it's outdated.
Probably you can use RadialGradient from my react-native-image-filter-kit package. Note that gradients from react-native-image-filter-kit are initially designed as primitives for blending with other images and your case is not something that was taken into account in the first place.
import { Image } from 'react-native'
import {
RadialGradient,
ImageBackgroundPlaceholder
} from 'react-native-image-filter-kit'
const imageStyle = { width: 320, height: 320 }
const gradient = (
<RadialGradient
colors={['red', '#00ff00', 'blue']}
stops={[0, 0.5, 1]}
image={
<ImageBackgroundPlaceholder style={imageStyle}>
/* your content here */
</ImageBackgroundPlaceholder>
}
/>
)

JSPdf autotable header border

How to create border in Header? I am using jspdf autotable to create table but cannot find any idea to apply border to header. Is there any hook that can be used to create header border?
You can use the header styles:
doc.autotable(columns, data, {
headerStyles: {
lineWidth: 1,
lineColor: [255, 0, 0]
}
});
As of today (version 3.5.25) the property name is headStyles and still different border widths is not supported.
Example:
autoTable(doc, {
headStyles: {
lineWidth: 0.5, // 1 is too thick for me
lineColor: [255, 0, 0] // Or gray level single value from 0-255
}
})
I use the imported method version (autoTable) in TypeScript.

Is there a way to dynamically allocate variables in this SCSS fade scheme?

My end product here is a situation where I can have different levels of a fade effect on my links and hover. So in this situation, it won't matter what color I chose for theme background, the links and hover will change to match. This will also also allow for using the fade variable to style any other element.
I setup a CodePen to demonstrate this http://codepen.io/SiscoKid/pen/dMzXzJ.
I would like to clean this up and also extend it to include Internet Explorer functionality.
// Fade
$fade-base: #fff;
$fade0: rgba($fade-base, 0);
$fade1: rgba($fade-base, 0.1);
$fade2: rgba($fade-base, 0.2);
$fade3: rgba($fade-base, 0.3);
$fade4: rgba($fade-base, 0.4);
$fade5: rgba($fade-base, 0.5);
$fade6: rgba($fade-base, 0.6);
$fade7: rgba($fade-base, 0.7);
$fade8: rgba($fade-base, 0.8);
$fade9: rgba($fade-base, 0.9);
$fade10: rgba($fade-base, 1);
//
// Color
$test-color: #f00;
$theme-base: #483; // CHANGE ME
$title-color: $fade5;
//
// Links
#mixin links() {
a {
color: $fade3;
&:hover {
color: $fade1;
}
}
}
//
// Body
#mixin main() {
#include links;
background-color: $theme-base;
}
.main {
#include main();
}
I want to be able to do something like:
color: $fade(0.3);
Instead of:
color: $fade3;
So what is the best way to achieve this expanded functionality?
I have done some research and found that we cannot dynamically assign these variables.
dynamic variables #1450
I'm not completely sure exactly what the end product is your trying to achieve here, but it does feel like it's creating needless CSS code.
Whats wrong with
&:hover {
background-color: rgba($fade-base, 0.9);
}
I'm not sure why you need to add a layer of complexity by wrapping it in a method?
I was able to develop a function to do this for me. I have also expanded this idea to include background-color fade accessibility.
//
// Fade
#function fades($percentage) {
#return lighten(255, (1-$percentage)*5%);
}
#mixin fade($type, $percentage) {
#if $type==cl {
color: rgba(#fff, $percentage);
}
#if $type==bg {
background-color: rgba(#fff, $percentage);
}
}
//
// Title
.title {
#include fade(cl, .5);
}
I am still unsure about expanding this for IE, as well as, dynamically creating gradient type classes. However, I think these might be topics for other questions.
Here is a link to the working CodePen.
Fade SCSS Function and Mixin
Thanks again to petehotchkiss for his feedback on this topic.

Convert SASS map to individual variables [duplicate]

This question already has answers here:
Creating or referencing variables dynamically in Sass
(7 answers)
Closed 7 years ago.
Edit: I've come up with a solution, see my answer below.
Is there a way to do this? It is becoming quite cumbersome typing map-get($myArray, myKey). I have an array with dozens of values in, it would be very helpful if I could export them.
So that this:
$map: (
width: 100px,
height: 200px,
color: red,
background: blue
);
.myselector {
width: map-get($map, width);
height: map-get($map, height);
color: map-get($map, color);
background: map-get($map, background);
}
Becomes this:
$map: (
width: 100px,
height: 200px,
color: red,
background: blue
);
/* some function to convert the map to vars */
.myselector {
width: $width;
height: $height;
color: $color;
background:$background;
}
Please note that the example I have given is purely arbitrary.
Update: Ok, I've come up with a crafty half-fix. (Although this will be obvious to any discerning SCSS journeyman...)
As long as the elements you are trying to get are from the same array, you can always take advantage of the javascript style scope inheritance, and write a function with a short name that will pluck the element with the specified key from your array.
In reference to the example I gave originally:
#function g($key) {
#return array-get($map, $key);
}
.myselector {
width: g(width);
height: g(height);
color: g(color);
background: g(background);
}
For a single array with dozens of elements that you have to access frequently, it has the desired effect, and actually gives a feeling of the more convenient PHP style array syntax. i.e. instead of $g['width'] you use g(width)
$map: (
width: 100px,
height: 200px,
color: red,
background: blue
);
.myselector {
#each $prop, $val in $map {
#{$prop} : $val;
}
}
You can use #each. In the above #each loop, i'm cycling over each key/value pair in $map, assigning the key to $prop and the value to $val.
If you want, you can make a mixin (for example):
#mixin create-props($array) {
#each $prop, $val in $array {
#{$prop} : $val;
}
}
.myselector {
#include create-props($map);
}

jquery animation help

I have two circles, one is small (thumb) another one is big (info), and when the user hover over the small (thumb), then the small icon need to resize in to big one. I also need to show the new information in the big. I think I have to do this by width and height animation, because small is 100px X 100px, and big is 200 X 200 size.
Please advice on the best way to do this. I would like to avoid using plug-ins.
using jquery 1.4.2 or up, you can achieve this by using:
$(".smallCircle").hover(
function () {
$(this).animate({
width: '200px',
height: '200px'
}, 200, function() {
// Animation complete.
//do whatever
});
},
function () {
$(this).animate({
width: '100px',
height: '100px'
}, 200, function() {
// Animation complete.
//do whatever
});
});
put the class "smallCircle" in the small circle.
P.S. in each state of the hover, you can control what happens after the animation is done (the place where I put "//do whatever"), that's the place where you could insert the content of the big cicrle.