Jump to content

Chart positioning


Talco

Recommended Posts

I'm still working through the setup for the new project. Its been the most complicated one I have done and I want to thank everyone here for the help they have provided.

 

Right now, I'm fighting the positioning of of a variable chart. The client needs/wants the X-Axis to print at an angle. I have that part working (using FindTextFrame). But they are at a fixed position. I'm forcing my chart to each have the same number of records. But the horizontal scale of the chart is changing depending on the numbers the chart is creating. If they are 1 digit, two digits or three digits it dramatically changes the chart and forces my X-Axis to be way off.

 

If there any way to force the Y-Axis the chart creates to always be two digits?

 

Or a way to make the actual chart area itself to be static?

 

I have attached a jpg file to so how and why its scaling. It contains 4 charts.

 

Any suggestions would be greatly appreciated.

 

Ronnie

Chart-movement.thumb.jpg.a8c4b678e95ee241834e79dc0986bc06.jpg

Link to comment
Share on other sites

Why do you want to force there to always only be two digits? The chart at the bottom uses three digits. I wrote some code that will format every number to have 4 digits. Then it checks to see if the first digit is a zero. If the first digit is a zero, it changes the color of the leading zero to white to avoid numbers like: "05.50" or "00.75" and you'll be left with "5.50" or "0.75".

 

This gives the illusion of a floating Y-Axis but also maintains a 4 digit place holder.

 

It will probably need to be tweaked since I don't know exactly what you're trying to achieve:

var s = Field("YourFieldHere");
var result = "";
s = FormatNumber("00.00",s);
// does the string start with 0? If so, set the first zero to be white
result = (s.indexOf("0") != 1) ? "<span color = \"White\">0</span>" + Right(s,4) : s;
return result;

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...