will-tm / wmgaugeview Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
One more time Hello and sorry to bother you.
If I ask you to make one more enhancement in rangeLabelsFont to have the ability to set the color of the text please do not scream!!
George Gerardis
Missing UIKit import reference - fails to compile without it if not using the pods install method.
Needle center is ok on IOS 7 but on IOS 8 and above, the center of needle is moved slightly on the right with the result NOT showing the values precisely.
Can you update your excellent control for IOS 8 and above?
Thank you very much
George Gerardis
Hey,
I'm trying to use this library with swift, but for some reason I get this weird double drawing of numbers.. what could be the problem? someone knows?
I've added the WMGaugeView as a subview to UIView which sits inside a custom table cell. This is my code:
cell.gaugeView = WMGaugeView(frame: cell.gaugeContainerView.bounds)
cell.gaugeView?.backgroundColor = UIColor.clear
cell.gaugeView?.showScaleShadow = false
cell.gaugeView?.innerBackgroundStyle = WMGaugeViewInnerBackgroundStyleFlat
cell.gaugeView?.scalesubdivisionsaligment = WMGaugeViewSubdivisionsAlignmentCenter
cell.gaugeView?.needleScrewStyle = WMGaugeViewNeedleScrewStylePlain
cell.gaugeView!.minValue = -30
cell.gaugeView!.maxValue = 30
cell.gaugeView!.showRangeLabels = true
cell.gaugeView!.rangeValues = [10, 20, 30]
cell.gaugeView!.rangeColors = [UIColor(red: 27.0/255.0, green: 202.0/255.0, blue: 33.0/255.0, alpha: 1.0), UIColor(red: 232.0/255.0, green: 111.0/255.0, blue: 33.0/255.0, alpha: 1.0), UIColor(red: 231.0/255.0, green: 32.0/255.0, blue: 43.0/255.0, alpha: 1.0)]
cell.gaugeView!.rangeLabels = ["SAFE FREEZER ZONE", "HIGH", "DANGER ZONE"]
cell.gaugeView!.unitOfMeasurement = "temp"
cell.gaugeView!.showUnitOfMeasurement = true
cell.gaugeView!.scaleDivisionsWidth = 0.008
cell.gaugeView!.scaleSubdivisionsWidth = 0.006
cell.gaugeView!.rangeLabelsFontColor = UIColor.black
cell.gaugeView!.rangeLabelsWidth = 0.04
cell.gaugeView!.rangeLabelsFont = UIFont(name: "Helvetica", size: 0.04)
cell.gaugeView!.setValue(Float(item.temperature!), animated: true, duration: 5.0)
cell.gaugeContainerView.addSubview(cell.gaugeView!)
Thanks
I am getting this error.
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString sizeWithAttributes:]: unrecognized selector sent to instance 0xa4c02d0'
in my iOS 6
It would be cool to be able to set a logarithmic scale for the gauges, so that it will show significant needle movement when in low ranges of values as in high ones.
Is it possible to make the view half circular?
Hello again,
I am thinking if you can add an enchancement in your tool.
The ability to represent also negative percentage.
Let say we have in the middle the 0 and on the right bottom the 100% and on the left bottom the -100% So, if I have a value +20% the radius indicator will be in the right part or if I have a value of -33% the radius indicator will be in the left part.
Thank you very much.
George N. Gerardis
Is it possible to have negative value in Gauge Charts? Thanks
Hello again,
Your excellent tool still has a problem running in iOS 6.0
I attach two views from my app running in IOS 6. 0 ( Problem - first )
and from IOS 7.0 ( Fine - second )
![ios simulator screen shot 06 2014 - 12 52 32]
(https://cloud.githubusercontent.com/assets/3070525/2888099/0f12dd82-d505-11e3-95f1-26e91171b498.png)
I changed the following _gaugeView.maxValue = 240.0; _gaugeView.showRangeLabels = YES; _gaugeView.rangeValues = @[ @50, @90, @130, @240.0 ];
into _gaugeView.maxValue = 1000; _gaugeView.showRangeLabels = YES; _gaugeView.rangeValues = @[ @50, @90, @600, @1000.0 ];
and I am getting the output as
. That is the subdivisions are not updating properly. So I am asking is what is the algorithm we are supposed to follow here? Is there any calculations to be followed to acheive the correct view for any random value a user is giving? Thanks in advance.
Hello,
Can you help on how to use unitOfMeasurementColor ?
I try : unitOfMeasurementColor = [UIColor yellowColor];
but I got error of incompatibility UIColor and CGFloat............
George Gerardis
Hi,
I'm kind of new in the matter. Just wanted to know if it's possible to use this in a Swift project.
Thanks for your time.
Regards,
Hi,
First off thanks for the awesome control. You provide a lot of customizations than any other gauge control.
I'd like to propose adding a property to hide/display the unit numbers. Just the scales and range colors.
Please implement it if you can. :)
Thank you.
Hello, Good morning.
First of all thank you for fixing what I had proposed. Your help is valuable.
Now I want to INFORM you for a bug and a possible enchancement.
Bug : I have a viewcontroller with 3 subviews in each I display your tool with different value ofcourse. In Simulator everything Works fine. In Real device everything is fine except one thing. The needle in all three WMGaugeView moves all the time without to stop and point to the right values. WHY?
Thank you very much again!
George N. Gerardis
Can you make the update to iOS8, please?
Thank you for your fantastic Tool. Very nice indeed.
I want to propose an enhancement if you can of course.
Can we have min - max and also if we can have min negative.
Let say from min = -100 to max = 100
This will be a nice addition!
Thanks again
George N. Geradis
Nice Job till now!
You help all of us using your tool.
I am waiting the bug fix about "Needle never reach target on iPhone"........
Also, are you going to add the possibility of choosing the color of the font in MeasurementUnit?
Thanks a lot
George Gerardis
Hello again,
I found a bug when your tool run on an iPhone with IOS 6.0 or IOS 6.1 and the app crashes!
I get the following error :
The error happens in the following line of your code :
CGSize fontWidth = [_unitOfMeasurement sizeWithAttributes:stringAttrs];
Can you please correct this?
In IOS 7.0 everything is FINE!!!!
P.S. In XCODE if you choose Product > Archive..... You will see a lot of warnings too!
Thank you very much.
George Gerardis
Trying to add a value label on the bottom.
Hope I can add a animation label text, it can sync with the needle.
Please, remove ViewController and AppDelegate .h and .m files from pod. It can lead to "duplicate symbols error". Just leave WMGaugeView .h and .m
Is there any swift implementation of this project? I couldn't find any.
I'm seeing some issues with the font kerning in the example images. They generate weird spaces. You might benefit from my XMCircleTypeView.
https://github.com/MichMich/XMCircleType
Keep up the good work!
Needle drawing in drawing consume a lot of CPU. CALayers and Core Animations should be a huge improvement.
Nice Job till now!
You help all of us using your tool.
I am waiting the bug fix about "Needle never reach target on iPhone"........
Also, are you going to add the possibility of choosing the color of the font in MeasurementUnit?
Thanks a lot
George Gerardis
Possible enchancement : Can you add the possibility in unitofMeasurement text to be able to choose by myself textfont, testfontsize and textfontcolour? Only for unitofMeasurement text.
I think if the scale label towards up will be easy to see.
I'm trying to do this.
'drawScale:' only draw (main) scale divisions on some condition( min:0 ~ max:1 or max value is not multiple of 10, ex. 732)
i modify code that determine main or sub divisions. see below
....
int subDivs = (int)_scaleSubdivisions;
...
// Division
//if ((abs(mod - 0) < 0.000001) || (abs(mod - div) < 0.000001))
if(i == 0 || i == (totalTicks-1) || 0 == (i % subDivs) )
{
Why "flat" version text is blurred?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.