Changing the column labels color based on width of chart [closed] - bar-chart

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I have created a bar chart that has the values of each of the columns at the end of each bar. The color of the bars is the same as the text of the values. The problem is that based on the width of the container/browser by default the values move inside the bar. But then you can't read the text as the bar and text are the same. I would prefer to have the values outside the bar but when they have to move inside the bar due to space is there a way to change the font color to white so that it is readable? Here is an example of the chart.
https://playground.anychart.com/DAlu15WO/2

Unfortunately, there's no possibility to detect if the label was moved inside the bar or not. But you can enable label background to increase its readability like in the sample.
Pay attention to lines 96-97.
All available background settings you can find in the list.

Related

Hot to center those 3 divs into the body [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
Im wondering how to center those 3 divs into he body, i created 2 versions of the row, one with an extra outer wrap around the column and one without, Unfortuinatly since this html created with a page builder (WP visual composer) so i dont have 100% freedom to control the html structure. I tried margin: auto but couldn't make it to work.
You can find the divs im talking about on this page.
https://bonmedico.de/test/
Thanks
This question will be closed very soon because it's not according to SO rules. ( Read comments to your question to find about that ). You really should put more effort when writing questions.
But i took a look at your website. You can solve your problem in 2 ( maybe more ) ways.
add justify-content:center to the parent row of those 3 columns. Being a display: flex element it will center them horizontally.
using visual composer is easy. Just add 2 small columns ( empty ) left and right and a larger column in the middle. Something like 1/4 1/2 1/4. And in that ' bigger ' column you can add a new row continaing 3 columns ( like you have now ). Or there are more possibilities to do this. Just ' play ' around with visual composer

HTML or CSS code to repeat properly skew pattern [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
I have a pattern, that i would like to use on my website as background, that has skew shape. I wonder if there is an HTML or CSS code to shift second background closer to the left, to hide white get and make it look better. Thank you in advance.
skew pattern
Create a new image that is shifted horizontally so you have rectangle pattern. I created image but it is not as good as it can be because I do not have original.you can use it.
Your new image is here
div {
background: url(https://i.stack.imgur.com/pvap7.png);
}
<div style=width:1000px;height:1000px></div>
Instructions to create the image
I use program GIMP (http://gimp.org/). It is free.
Remove white area (make it transparent) using Fuzzy Select Tool and Delete key. If transparency is not enabled, right-click the layer and enable it.
Duplicate the image (Ctrl-C, then Ctrl-V)
Move it using Move horizontally so there is no transparent area between the two copies.
Press Ctrl-H (anchor the floating layer)
Right-click the top layer and Merge Down
Crop the image (Image→Autocrop Image)
Crop it to the center (Image→Canvas size…), set width 264 (width of one “block”) and then click Center button
Manually remove white pixels
Export it as PNG (in File menu)
Use it

Remove padding from text input [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
Is it possible to change the inner padding of text field? Currently when you take a normal text field in html and write something in there it'll have padding in the beginning and in the end of it. The numbers written in my text field have at most 3 digits and currently the padding pretty much covers the width of 1.5 to 2 digits and already with 2 digits (see number 10 on image) it'll get a bit dragged out.
Added image of it as well, in the first field the padded area is marked with red line.
I dont have code but
.my_input_class{
padding:0;
}
Or, really, the size of the text box needs to be a bit larger, or you put a character limit on it

Responsive design: How to adjust number of columns? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
My client wants to have a screen that, on a sufficiently high resolution monitor, lays out like this:
First name [textbox1a] Translation [textbox1b]
Last name [textbox2a] [textbox2b]
Street [textbox3a] [textbox3b]
Etc. (The screen shows information in 2 languages, but we needn't get into the details of what that's all about for purposes of this question.)
When the screen is too narrow for this to fit -- say on a tablet -- they want this to change to:
First name Translation
[textbox1a] [textbox1b]
Last name
[textbox2a] [textbox2b]
Street
[textbox3a] [textbox3b]
And on a very narrow screen -- say a cell phone:
First name
[textbox1a]
Translation
[textbox1b]
Last name
[textbox2a]
[textbox2b]
Street
[textbox3a]
[textbox3b]
I really don't want to make the labels fixed width because that would prevent a user from resizing the text. With variable width, I can't make everything float:left because then the columns don't line up. I'm tinkering with using display:table-cell et al but this gets tricky because what goes in each row changes. I think I can make that work if I use #media to switch from 4 column to 2 to 1 but that assumes I know the exact number of pixels when to switch layouts, which I don't without making assumptions about the width of the labels.
Any ideas how to do this?
So, the solution I came up with is to check and see which column is the widest. Then apply that width to every column while making the columns 'float'. That way they always line up.
var maxWidth = 0;
$('.box').each(function() {
var width2 = $(this).width();
if(width2 > maxWidth){
maxWidth = width2;
}
});
$('.box').css("width", maxWidth);
Here is a full JSFiddle for you, you can edit the contents of the boxes to change the size of them to test it out.
http://jsfiddle.net/na50mxtj/

Using 2 color functions in a mathematica matrix plot [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
I'm trying to use 2 color functions within one matrix plot in mathematica. Is this possible to do?
For example, using a very simple matrix:
test = Partition[Table[i, {i, 1, 9}], 3]
I would like to make the even numbers vary in color increasing from white to red; and the odd numbers vary in color from grey to black.
How could I do this? I know how to get the whole matrix to vary in color, but no more than this.
You could try defining a ColorFunction as below.
CheckerPlot[array_?MatrixQ] :=
With[{len = Length[Flatten[array]]},
ArrayPlot[array,
ColorFunction->(If[EvenQ[#], Blend[{White, Red}, #/len],
Blend[{Gray,Black}, #/len]] &),
ColorFunctionScaling -> False]
]
Execute by using, for example,
CheckerPlot[Partition[Table[i, {i,1,36}], 5]]