Jump to content
JChartFX Community
  • 0

Radial Gauge Animation Bad Values


mreschke

Question

Downloaded the full jChartFX package a week ago (not licensed v7.2.5289), built a very simple gauge with animation enabled, works mostly.  Notice in my script the needle value should be right at 82.  Every time I refresh the page the needle varies a bit.  It seems to just pick a random value around 82.  If I hover over the needle it may be 79.0 one time, 80.95 the next, then 81.1...what the heck?


 


I noticed, if I turn off animations, this doesn't happen, needle is exactly at 82 every time.  I notice on slower devices like a phone (android), the need stops even lower, so around 60 - 70.  


 


So animation bug?  Tested in Firefox and Chrome.  Phone is android with chrome.  All three are bad values when animation enabled.



/**
* Create a jChartFX radial gauge chart from a widget
* @param {object} widget
* @return {void}
*/
function radialGauge(widget)
{
// Chart Values
var min = 65;
var max = 100;
var value = 82;
var limit1 = 74;
var limit2 = 82;
var name = 'Test';

// New jChartFX Object
var chart = new cfx.gauge.RadialGauge();
chart.setMainValue(value);

// Titles
var title = new cfx.gauge.Title();
chart.getTitles().add(title);
title = chart.getTitles().getItem(0);
title.setText(name);

// Scale
var scale = chart.getMainScale();

// Sections 1st
var section = new cfx.gauge.ScaleSection();
section.setFrom(min);
section.setTo(limit1);
scale.getSections().add(section);

// Sections 2nd
section = new cfx.gauge.ScaleSection();
section.setFrom(limit1);
section.setTo(limit2);
scale.getSections().add(section);

// Sections 3rd
section = new cfx.gauge.ScaleSection();
section.setFrom(limit2);
section.setTo(max);
scale.getSections().add(section);

scale.setMin(min);
scale.setMax(max);

// Animations
chart.getAnimations().getLoad().setEnabled(true);

// Display Chart
chart.create('myChartDiv');
};

  • Like 1
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...