Jump to content
Software FX Community

Change anchor of X-axis labels to right hand side of chart


User (Legacy)
 Share

Recommended Posts

SoftwareFX:

I am using the ChartFX Client Server DLL to save a chart image as a BMP.

I have a line chart that has many more points than can be represented on the

X-axis. My current SKIP is 4--which seems to be about right. When the chart

draws the X-axis it starts with "first" data point on the left and draws a

label. Then it skips STEP number of points and draws another label. This

process continues until I run out of points.

Under normal circumstances this is exactly what one would want.

Unfortunately, my client is charting data from a point in time BACK in time

to some variable point in the past. So, he wants his "start" date to print

on the far right hand side and then chart toward the left as he goes back in

time. Of course, the only real difference between the two charts is that the

first chart always shows the earliest label and my client wants to always

show the latest label.

Any ideas?

Sean

Link to comment
Share on other sites

I see three options here:

1) If the chart is actually "reversed" you could pass your data from most

recent to oldest and the Invert the X-Axis so that is goes from right to

left, this will give you exactly what you are looking for as the most recent

point will be the first point in the chart.

2) Is reversing the data is not what you are looking for, you can FORCE the

last label by doing:

chart.AxisX.Style |= AxisStyle.ShowEnds;

This will force the last label to show regardless of the axis Step. You

might get overlapping labels in this case.

3) You may want to display that "last" date as a title aligned to the

Bottom-Right of the chart.

--

FP

Software FX, Inc.

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

 Share

×
×
  • Create New...