XY Axis labeling, offset on individual labels for space?

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
greggorob64
Posts: 183
Joined: Tue Mar 18, 2014 2:55 pm

XY Axis labeling, offset on individual labels for space?

Post by greggorob64 » Fri Apr 25, 2014 2:18 pm

I have to graphs in close proximity to each other (displaying a cross section). If you look in the bottom right, the last value (200) is jammed right up against the edge of the graph.

Are any of these options possible? I only need one (in order of preference). My goal is to have the spacing between the two charts only be 1px. Its currently more than 1px on account of the label spacing.

[*]Is there a way for me to offset the last label by a number of pixels?
[*]Is there a way for me to hide the last label completely?
[*]Is there a way for me to hide the first label of the second chart?

Image
I currently have that X axis with all auto-generated labels. I'm not using any custom ticks on that axis currently.

Thanks in advance!

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: XY Axis labeling, offset on individual labels for space?

Post by ArctionPasi » Fri Apr 25, 2014 2:34 pm

Using xAxis.FormatValueLabel event handler is one possiblity. You can return empty string if near chart border. Pass FormatValueLabel handler's value to xAxis.ValueToCoord method, and you'll get the center coordinate of string. To find out the total string length in pixels, you call chart.MeasureText method.

Something like that :P
LightningChart Support Team, PT

greggorob64
Posts: 183
Joined: Tue Mar 18, 2014 2:55 pm

Re: XY Axis labeling, offset on individual labels for space?

Post by greggorob64 » Thu May 08, 2014 2:18 pm

This method worked great. I added some padding to the farthest over label (by drawing "200 .") as the string.

Thanks!

Image

Post Reply