stherrienaspnet / ngradialgauge Goto Github PK
View Code? Open in Web Editor NEWAngular.js Radial Gauge
License: MIT License
Angular.js Radial Gauge
License: MIT License
Is it possible to change the font family of the gauges? I can't seem to do it.
I am trying to giving hover it's not working
Thanks for creating such a great chart!
Have you planned to integrate to use with Angular 2 or higher version? Thank you so much.
Hello,
I receive some exceptions with your plugin when I use it with tabs. The first panel is well rendered (if it's the active one), but not the others (which are hidden by default) :
The problem comes from line 214 :
var textWidth = dummyText.node().getBBox().width;
It seems getBBox()
does not work very well in Firefox when using it inside tab panels.
This issue advises to use getBoundingClientRect()
instead of getBBox()
, and it works for me.
By the way thank you for this plugin !
Any chance you can add bower support?
Could you give me the option of how to draw more than one needle inside the gauge? Please
I am using the below code,
$scope.majorGraduations = 10;
$scope.minorGraduations = 0;
Am I doing anything wrong here?
It's possible to force the easing direction?
If you put 0 as min value 4.5 as max value and you change currentvalue 0 to 4.4 you'll see the neddle torate ccw.
It's better to rotare CW when angle < 0 and CCW when angle > 0 .
Also a bug, if the value it's bigger than maxvalue, the neddle disappear.
When the angle between two values exceeds 180, the needle transition covers the area outside the gauge. This can be prevented by something like
var lastAngle = 0;
var onValueChanged = function (pValue, pPrecision, pValueUnit) {
if (typeof pValue === 'undefined' || pValue == null) return;
if (needle && pValue >= minLimit && pValue <= maxLimit) {
var needleAngle = getNewAngle(pValue);
var diff = needleAngle - lastAngle; //avoid overrun
lastAngle = needleAngle;
var n = needle, t = transitionMs;
if (Math.abs(diff) >= 180) {
t = transitionMs / 2;
n = needle.transition()
.duration(t)
.ease('linear')
.attr('transform', 'rotate(' + (needleAngle - diff / 2) + ')');
}
n.transition()
.duration(t)
.ease('bounce-in')
.attr('transform', 'rotate(' + needleAngle + ')');
svg.selectAll('.mtt-graduationValueText')
.text('[ ' + pValue.toFixed(pPrecision) + pValueUnit + ' ]');
} else {
svg.selectAll('.mtt-graduation-needle').remove();
svg.selectAll('.mtt-graduationValueText').remove();
svg.selectAll('.mtt-graduation-needle-center').attr("fill", inactiveColor);
}
};
With other words - splitting the transition in two and making sure that the intermediate value is inside the range.
Regards,
HeiDJ65
Hi,
The radial gauge is not showing up in iOS emulator. But its working perfectly in browser.
What is the issue?
We are attempting to use the gauge with Firebase and need to bind it to update as the data source updates. We have tried putting $scope.value in the $loaded() function but it does not work. Do you have any ideas on how we can bind the value to an object in the function?
How can I remove the unit value from the chart? As per the example, I am trying to remove the unit "Kw" from the chart, but I should have the unit for value.
When the gauge has a value that is outside of the lower and upper limit the needle is removed from the DOM. When the gauge is updated with a value that is within the lower and upper limit via ngOnChanges the needle is not redrawn.
I find that if I use data="..." attribute then the gauge flickers on update, if I use longer form of specifying values then transition is smooth.
ie.
<div width="300" ng-radial-gauge ranges="sweep.ranges" value="sweep.value" value-unit="sweep.unit"
precision="sweep.precision" lower-limit="sweep.lowerLimit" upper-limit="sweep.upperLimit">
</div>
<!-- Flickers with update to value -->
<div width="300" ng-radial-gauge data="sweep">
</div>
How would one set a % width for a gauge?
Specifying width="80%" results in width being set to 80 and not 80% of the available width.
Thanks
Thanks very much for adding Bower support. But it doesn't seam to work. A few comments (I'm not a bower expert though)...
Just my two cents.
Hope it helps.
Hi,
I'm trying to import this to an Ionic 3 project. Is it possible add a npm installer?
Thank you
Hi
I am using the radial gauge with an angle='90' and with needle-value-text-size='0' generating a SVG object with more height than what is really needed.
Is there a way to change that without changing the directive itself?
My project don't need decimal numbers. So I am hiding the precision for numbers. For even number Upper limit , the needle and graduations point correctly. But for odd upper limit the graduations doesn't come in the angles needed. Could you provide any solution or suggest what should be done. While rendering MajorGraduations the gauge is divided into 2 parts and then placing arc angles which is working fine with even numbers. These are functions that need to be changed. Hoping to expect an answer soon. Thank you.
var renderMajorGraduations = function (majorGraduationsAngles) {
var centerX = view.width / 2;
var centerY = view.width / 2;
//Render Major Graduations
getMajorGraduationValues
getMajorGraduationAngles
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.