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
I am working on visualization tree map which shows the product categories.There are two values of any range.First value decides size of segments and second value decides the color of segments.Now the conditions is if value is +ve then color range must be vary between green color and if -ve then value vary between red color (for big value color effect will be more dark and for small value color effect will be more light )
How do I done this .
the value ranges between 12 to 8 digits (- or +ve)
Help me please.
You would want start by looking at the colorWithHue:saturation:brightness:alpha: method of UIColor. The hue value will control choice between greens and reds. The saturation and/or brightness value will determine the "darkness", depending on what exactly you mean by "dark".
You can create a simple app with a UISliders for hue/sat/brightness and a UIView to display the selected color to experiment with HSB colors. Here's a gist that implements such a tool.
Related
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 2 years ago.
Improve this question
Need to draw a custom world map drawing either the complete world map or a certain region. Also highlighting different regions with different colours.
I have tried https://github.com/KiloKilo/WorldMatrix. I am able to colour the regions but unable to draw custom regions and provide custom colour to certain regions. Unable to find any other library.
Using below code, it shows nothing
let generator = WorldMatrixGenerator()
// Set the number of columns per rows (Default: 100)
generator.columns = 20
// Set your desired map cutting (Default: .world)
// use .custom(north, east, south, west) for a custom bounding
generator.mapCutting = .europe
// Set the output type (.enum, .ascii, .emoji) (Default: .enum)
generator.exportType = .enum
// Generates the world array
generator.generate()
Basically want to achieve the one in the image. Can someone let me know how can draw custom regions?
Thanks for the help in advance.
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 4 years ago.
Improve this question
This is what my graph currently looks like.
I am trying to put the axis labels on the right side of the left axis in ios charts by danielgindi as seen in the second picture above. Any suggestions, I have checked countless forums and posts send help.
As per your requirement you can use below property to get your YAxis labels inside chart.
Swift :
lineChartView.leftAxis.labelPosition = .insideChart
lineChartView.rightAxis.labelPosition = .insideChart
Objective-C:
self.lineChart.leftAxis.labelPosition = YAxisLabelPositionInsideChart;
self.lineChart.rightAxis.labelPosition = YAxisLabelPositionInsideChart;
Hope this will helps!
Output :
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 5 years ago.
Improve this question
Hey I was trying solve this problem . Where you're asked to segment out "zebra" out of image. Below is the given image.
And output should be like this.
Well I got stuck at "strips" of zebra cause they may get segmented as separate objects.
In image processing, it is important to look at your image and try to understand the difference between your region of interest, i.e. the zebra, and the rest, i.e. background.
In this example, a clear difference is that the background is rather greenish and the zebra black and white. Therefore, the green channel of the image can be used to extract the background. Afterwards the result can be (non-linearly) cleaned up using some dilation and erosion steps.
A simple and non-perfect segmentation technique is (in Matlab):
I = imread('lA196m.jpg');
% plot the original image
figure
subplot(2,2,1)
imshow(I)
% calculate the green channel (relative green value)
greenChannel = double(I(:,:, 2))./mean(I(:,:,:), 3);
binary = greenChannel > 1; % apply a thresshold
subplot(2,2,2)
imshow(binary);
% remove false positives (backgrounds)
se1 = strel('sphere',20);
binary2 = imdilate(imerode(binary,se1), se1);
subplot(2,2,3)
imshow(binary2);
% add false negatives
se2 = strel('sphere',10);
binary3 = imerode(imdilate(binary2,se2), se2);
subplot(2,2,4)
imshow(binary3);
% calculate & plot the boundary on the original image
subplot(2,2,1)
Bs = bwboundaries(~binary3);
B = Bs{1};
hold on
plot(B(:, 2), B(:, 1), 'LineWidth', 2);
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
I am trying to make a rating form in iPhone. I am using sqlite manager. If a user clicks the rating form(stars) the rating will be stored in a database. I dont have any idea how to store the rating(stars) in the database. Please give me any idea how to store rating(stars) in a database.
I am following this link how to develop stars rating. Thanks in advance.
Store it as a integer value. Eg. If 2 star save 2 in database.
If you .5 rating also then save it as float. Eg. If 2 and half start then save 2.5 in database.
Depending upon the value draw your stars.
Giving ratings is nothing but the magic of images. Here's the logic for this..
Follow the steps explained below:
1. Prepare 3 images for each star
1.1 Unselected star (Gray Star)
1.2 Half Star (Half Gray/Yellow star)
1.3 Full Star (Yellow star)
2. Initially all 5 stars are fully gray & db value for ratings field is 0
3. Now prepare condition,
3.1 if User clicks one time then it receives half star, the image is changed from gray to half gray & the database value will be changed from 0 to 0.5
3.2 if User clicks again then the image will be changed from half gray to fully green & the database value will be changed from 0.5 to 1.0
Now if user clicks the green star
4.1 the image will be changed from 1.0 to 0.5 and, the ratings field in database will be from 1.0 to 0.5
4.2 if user clicks again the half gray star then the value in the db will be changed from 0.5 to 0 & the image will be fully gray star.
Enjoy Programming !
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
I have a canvas which contains a single myComponentA. A myComponentA contains a MyComponentB. The myComponentB contains a number of myComponentA's giving a tree structure...Ok so far.
The structure is stored as an XML file.
When I load a big (60 or so components), the components are not visible... When I change the player quality to low or medium they appear...!?
Towards the bottom of the diagram a component is clipped through the middle as though it has been cut off...(The containing canvas continues on empty...)
This is probably an issue with the flex measuring mechanism. Your myComponentA should probably report its measuredHeight and measuredWidth to the parent container. This will likely be done, in your case, in an override of the measure function. e.g,
override protected function measure():void {
measuredWidth = //x position + width of rightmost child
measuredHeight = //y position + height of bottommost child
super.measure();
}
If you do something like this in both myComponentA and myComponentB, and you inherit from a Container (e.g., canvas) then things should work mostly. If your components inherit from UIComponent, you might have more trouble (i.e., there won't be any scrollbars).
Keep in mind that the measure function only sets the measuredHeight and measuredWidth. Depending on your situation, you may need to overide updateDisplayList as well to properly set the actual height/width/positions of the children.