Jump to content
Software FX Community

Y-axis formatting


User (Legacy)

Recommended Posts

I am trying to format a financial chart that has price on the y-axis and 

date on the x-axis. I have it displaying just fine and everything but I need

to have the y-axis always include the price $1000. I coded an algorithm to

automatically put $1000 in by setting the step and number of ticks, but the

prices are awkward numbers and I need them to be whole, "nice" numbers like

$50 incrememts. I can't just say I want $50 incrememts because the chart can

have a range anywhere from $1 to $100,000. I also set the first value to be

$1000 but I cannot to that because the values are not always increasing. (I

will have prices below $1000)

Does anyone have any ideas as to how to get the numbers to show nicely, like

ChartFX does automatically, but to have it also include $1000?

Thanks,

Braden Hays

Attachments.zip

Attachments.zip

Link to comment
Share on other sites

Maybe a different approach but how about not touching the Y axis (so that 

ChartFX will choose the right step depending on the scale) but create a

constant line at 1000, if 1000 is special to this chart, the constant line

API will allow you to add a string, set the constant line color and style so

that it stands out from the axis gridlines.

e.g.

ConstantLine constLine = chart1.ConstantLines[0];

constLine.Value = 40;

constLine.Text = "Special Value";

constLine.Color = Color.Red;

constLine.Axis = AxisItem.Y;

Regards,

JC

Software FX Support.

"Braden Hays" <bhays@altegris.com> wrote in message

news:VflIWPkgFHA.1484@webserver3.softwarefx.com...

>I am trying to format a financial chart that has price on the y-axis and

>date on the x-axis. I have it displaying just fine and everything but I

>need to have the y-axis always include the price $1000. I coded an

>algorithm to automatically put $1000 in by setting the step and number of

>ticks, but the prices are awkward numbers and I need them to be whole,

>"nice" numbers like $50 incrememts. I can't just say I want $50 incrememts

>because the chart can have a range anywhere from $1 to $100,000. I also set

>the first value to be $1000 but I cannot to that because the values are not

>always increasing. (I will have prices below $1000)

>

> Does anyone have any ideas as to how to get the numbers to show nicely,

> like ChartFX does automatically, but to have it also include $1000?

>

> Thanks,

> Braden Hays

>

>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...