Jump to content
Software FX Community

X axis label of last point in series


Recommended Posts

hi,

Is it possible to make sure that the last point in a series is labelled on

the x axs?

My specific example is an xy line graph where the x axis values are dates.

It's important that the most recent date (ie the last point in the series)

is explicitely labelled. Can this be done?

thanks,

Rob

Link to post
Share on other sites

> Try this:

>

> chart.AxisX.Style |= AxisStyle.ShowEnds;

cheers, that works.

inidentally, shouldn't that also cause the other end of the x-axis to be

labelled? It only sems to affect the

right hand end (which is what I want, but... B)

also, how can I make sure the end of axis label doesn't overlap the

automatically generated labels?

Rob

Link to post
Share on other sites

> inidentally, shouldn't that also cause the other end of the x-axis to be

> labelled

No. Only if the axis has two halves (positive and negative) the ShowEnds

will affect both ends.

If you want to control where the labels start, you must use the FirstLabel

property.

> also, how can I make sure the end of axis label doesn't overlap the

> automatically generated labels?

I'm afraid you can't have it both ways, if you force the label to show it

may overlap other labels. What do you want to do when there is no room ? we

can't make the screen grow :-)

Maybe if you provide me with an specific example of what would you like

Chart FX to do with a specific dataset I could point you to some other

properties that may allow you to achieve what you want.

--

FP

Software FX

Link to post
Share on other sites

> I'm afraid you can't have it both ways, if you force the label to show it

> may overlap other labels. What do you want to do when there is no room ?

we

> can't make the screen grow :-)

No, but you could make it smart enough to detect when labels overlap, and if

they do, give priority to the more important one (ie the end label, since it

has been specifically requested)

> Maybe if you provide me with an specific example of what would you like

> Chart FX to do with a specific dataset I could point you to some other

> properties that may allow you to achieve what you want.

thanks but no, I need to make it work nicely for runtime generated data

cheers

Rob

post-2106-13922379459283_thumb.png

Link to post
Share on other sites

I know that ! My question was what would YOU like Chart FX to do ?

Hide the label right before it (27/12/2002) ? If so that sounds like a good

suggestion, I will included it in our Wish-List.

You can do this on your own now by capturing the GetAxisLabel event, detect

that it is the label before the last (based on its value and AxisX.Max) and

return an Empty String for it. You can do this only when the difference

between the last label and the Max is less than a certain number.

--

FP

Software FX

post-2107-13922379460139_thumb.gif

Link to post
Share on other sites

> I know that ! My question was what would YOU like Chart FX to do ?

>

> Hide the label right before it (27/12/2002) ? If so that sounds like a

good

> suggestion, I will included it in our Wish-List.

I'd like it to hide the label before if

- it overlaps the end-of-axis label, or

- the gap between the two labels is less than a certain distance, say the

height of the label font

> You can do this on your own now by capturing the GetAxisLabel event,

detect

> that it is the label before the last (based on its value and AxisX.Max)

and

> return an Empty String for it. You can do this only when the difference

> between the last label and the Max is less than a certain number.

sounds like a good workaround, I'll try that

cheers

Rob

Link to post
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
Reply to this topic...

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