Jump to content
JChartFX Community
  • 0

Linear Gauge


hofermic

Question


var verticalGauge1 = new cfx.gauge.VerticalGauge();

var border = verticalGauge1.getBorder();
border.setTemplate("<DataTemplate></DataTemplate>");

var mainScale = verticalGauge1.getMainScale();
mainScale.setMin(0);
mainScale.setMax(PeerGroupCount);
mainScale.setThickness(.3);
mainScale.setPosition(-.5);

var bar = mainScale.getBar();
bar.setThickness(0.01);
bar.setPosition(1);

var marker = new cfx.gauge.Marker();
marker.setPosition(0.65);
verticalGauge1.setMainIndicator(marker);

var tickMarks = mainScale.getTickmarks().getMajor();
tickMarks.setStyle(cfx.gauge.TickmarkStyle.Line);
tickMarks.setSize(0.2);
tickMarks.setWidth(0.05);
tickMarks.setPosition(1);

var mediumTickMarks = mainScale.getTickmarks().getMedium();
mediumTickMarks.setVisible(true);
mediumTickMarks.setStyle(cfx.gauge.TickmarkStyle.Line);
mediumTickMarks.setSize(0.15);
mediumTickMarks.setWidth(0.03);
mediumTickMarks.setPosition(tickMarks.getPosition());

verticalGauge1.setMainValue(YourRank);

var title = new cfx.gauge.Title();
title.setAngle(0);
title.setDock(cfx.gauge.DockArea.Bottom);
title.setText(YourRank + " of " + PeerGroupCount);
title.setTextColor("#00FF00");

verticalGauge1.getTitles().add(title);

verticalGauge1.getAnimations().getLoad().setEnabled(true);
verticalGauge1.create('ChartDiv3');


I am trying to use a Vertical Gauge to show where a score falls in the rank of the peer group. I want 1 to be on top and the total count of peers to be on the bottom. The lower the number, the higher your rank. The VerticalGauge starts with the low values on the bottom and the high values on top. When I set the Min to be larger than the Max, the gauge does not work, the marker is always placed on the very bottom of the gauge.

Does anyone know how I can accomplish this?

 

 

 

 

 

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Unfortunately the current build does not support inverting the scale for a linear or radial gauge.

 

We will add support in our next build for this through a setInverted(bool) method in the scale, if you are interested in getting an early build, please check as soon as the unstable build's minor revision is 5617 or later or drop a message to our support team and point to this message.

 

Regards,

 

JuanC 

Link to comment
Share on other sites

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...