JFreeChart gridline? paint set [closed] - colors

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 8 years ago.
Improve this question
I have this chart and I want the line at 0 to be WHITE instead of BLACK, but I'm not sure which property I have to change.
I've already tried:
((CategoryPlot) chart.getPlot()).getDomainAxis().setAxisLinePaint(Color.WHITE);
((CategoryPlot) chart.getPlot()).setDomainGridlinePaint(Color.WHITE);
((CategoryPlot) chart.getPlot()).setRangeGridlinePaint(Color.WHITE);
And none of them seem to be what I need. I also tried searching for a solution, but I'm not sure what this line is called exactly, so I don't really know what to search for. Can someone please tell me which property I need to set to WHITE?

The line drawn perpendicular to the range axis (y-axis) at the value zero is referred to in JFreeChart as the rangeZeroBaseline. The method you need is:
http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/plot/CategoryPlot.html#setRangeZeroBaselinePaint-java.awt.Paint-

Related

how to implement quest pointer guide in godot 3? [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 last year.
The community is reviewing whether to reopen this question as of last year.
Improve this question
I am making a 2d platformer.(using gdscript)
I have been trying to make a guide arrow that shows you where to go and have been failing. I far as I can see there is no godot tutorial for this yet.
I have however managed to find a unity tutorial but have been having a hard time converting the instructions to godot.
https://youtu.be/dHzeHh-3bp4
Thanks in advance :)
I'll assume the indicator is a Sprite with whatever icon you want to show.
By the way, you are going to need a reference to the Camera2D. Unlike in 3D where you can ask Godot for the current Camera, you will have to handle references to the current Camera2D yourself.
I'll assume you already have the reference to the Camera2D (perhaps you have the code in the Camera2D script) and the reference to the indicator Sprite (which is another possible place to have the code).
I'll also assume you don't have a rotated Camera2D.
First we need the center of the screen:
var center := camera.get_camera_screen_center()
Then we can get the vector to the position we want:
var vec := target - center
Where target is the position in global coordinates you want to point to. By the way, if vec is Vector2.ZERO, then the target at the center of the screen.
Let us clamp it by the size of the Viewport. We are going to use half the size since we are measuring from the center of the screen. I'll also add a margin, I'll come back to that, for now, assume margin = Vector2.ZERO.
var helf_size := (get_viewport().size - margin) * 0.5
var clamped_vec := Vector2 (
clamp(vec.x, -half_size.x, half_size.x),
clamp(vec.y, -half_size.y, half_size.x)
)
If those are equal, it means the target is on the screen (it didn't need to be clamped):
if clamped_vec == vec:
# target on screen
pass
else:
# target out of screen
pass
Now, to place the indicator we need two things: a rotation and a position, correct?
The rotation is easy. It is the angle of our vec:
sprite.global_rotation = vec.angle()
And for the position, well, it will be our clamped_vec except we need to place the indicator. So we need to add a... Margin! Aha! So, adjust the margin to the size of the indicator you have, and clampled_vec will give us the position, we just need to add center back:
sprite.global_position = clamped_vec + center
And that should do it.

Svelte + dynamic SVG (chessboard usecase) [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 2 years ago.
Improve this question
I have the following code inside Svelte REPL:
https://svelte.dev/repl/b96c96bb3a654f5a81813525d22a8820?version=3.29.0
There's a problem: the chessboard doesn't appear, or at a better case (without onMount) flashes while appearing, and then disappears...
What's wrong in this code and how to fix that ?
I think the problem for you is coming from how you're attempting to push cells to defs. When you replace defs.push(cells) on line 36 with defs = [...defs, cells] it allows the columns and rows to be created properly. Then for some reason you're setting xmlns through a variable... this is the main thing preventing anything from showing up. There is no reason to use a variable to set xmlns, pretty sure it's preventing the SVG from being created properly when done this way and you don't actually need xmlns for inline SVGs, so you can trash that and all works well as shown here.
However, unless you're planning on using the empty space inside the 1000 x 1000 SVG area then I'd advise you to cut it down to 800 x 800 so the squares fit into the overall dimensions better.

Finding the most colorful in a number of hex-colors [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
in order to generate a dynamic color scheme for a webpage I read the dominant colors from an image. These include some very dark and some very light colors. All of which are not very good in being a base for a color scheme.
I need to select the most colorful/satured color from a set of colors.
I've looked at the HSL-values and thought about using those with the highest S and L values but this can also give me some very "dirty" colors.
Is there a good way the solve this? Somehow this seems like the way IOS7 selects a color from album art.
Thanks for any help!
Your best bet is to use the HSL conversion with custom mapping to avoid any hues you don't want:
CGFloat hue; // in degrees, [0,360)
NSArray undesirableHueRanges = #[NSMakeRange(25, 20), NSMakeRange(180, 20)]; // e.g., you don't want colors with hues between 25º to 45º and 180º to 200º
for (NSRange undesirableRange in undesirableHueRanges) {
if (hue > undesirableRange.location && hue < NSMaxRange(undesirableRange)) {
if (hue > undesirableRange.location + 0.5 * undesirableRange.length) {
hue = NSMaxRange(undesirableRange);
} else {
hue = undesirableRange.location;
}
}
}
Don't forget to use the built-in color picker in most Mac apps (including Xcode) to play with different color modes:

adding new syntax formatting to existing filetype [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
So I have some custom vi coloring in a syntax file.
This works perfectly (giving a blue background to lines 20-30)
syntax region mytest start="\%20l" end="\%30l"
hi mytest ctermbg=Blue
This does not work at all (attempting to give a blue background to a range that starts with x and ends with y):
syntax region mytest2 start="x" end="y" fold transparent
hi mytest2 ctermbg=Blue
I'm trying to figure out how to give formatting between a start/end point. Any help is appreciated.
I misunderstood the function of "transparent". Removing transparent fixes the issue.

Photoshop CS5 - making text have effect but with a transparent fill....totally stuck [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I have been using Photoshop for about three weeks now, finding it very different to fireworks...
Im trying to make a cool effect on my site, I want to use JQuery to slide a background image behind some text, and the background show through the text. I need to text to be placed in a white box, with the text itself "punched" out, so you can literally see through it (but only the text, the white box will cover everything else). The text also needs an inner shadow effect...just no fill. I am having real problems finding this info, can anyone help?
Many thanks, Dan
Create your white background layer
Create your text layer with the font and size you want
Ctrl+Click the text icon in the Layers panel to select the outline of your text
Select your white background layer and press delete to cut the text shape from your background
Select your text layer and delete it
Apply your drop shadow or glow filters to your background layer
Save as a transparent PNG-24
Your question doesn't sound too clear but i think animating the opacity of either of text or background would help.check this

Resources