Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

Uneven X-Axis Label Spacing #302

Open
pixatra5163 opened this issue May 25, 2017 · 2 comments
Open

Uneven X-Axis Label Spacing #302

pixatra5163 opened this issue May 25, 2017 · 2 comments
Labels

Comments

@pixatra5163
Copy link

pixatra5163 commented May 25, 2017

I integrated the line graph and its working great in Objective-C, but the problem I'm having is with spacing on the xAxis. If you see the attached screenshot, the first label and second one, and second last and last one are not evenly spaced.

Below is the function which I use to setup the graph:

- (void)setupGraphs {
      mindfulGraph.enableXAxisLabel = YES;
      mindfulGraph.alwaysDisplayDots = YES;
      mindfulGraph.colorXaxisLabel = [UIColor lightGrayColor];
      mindfulGraph.colorBackgroundXaxis = [UIColor clearColor];
      mindfulGraph.enableYAxisLabel = YES;
      mindfulGraph.colorYaxisLabel = [UIColor lightGrayColor];
      mindfulGraph.colorBackgroundYaxis = [UIColor clearColor];
      mindfulGraph.enableReferenceYAxisLines = YES;
      mindfulGraph.colorReferenceLines = [UIColor lightGrayColor];
      mindfulGraph.enableLeftReferenceAxisFrameLine = YES;
      mindfulGraph.enableReferenceAxisFrame = YES;

      mindfulGraph.enablePopUpReport = YES;
}

0-neu-d2-47c91b1ae3cd8513e6bb9c835e1a9580

@mackworth
Copy link

That's a design choice. As the labels are centered on the datapoints, the far left and right labels would always be half off the screen. Thus the library nudges them into the visible area. If you turn on xaxis reference lines, the issue will be clearer to you.

@Sam-Spencer
Copy link
Collaborator

This is the default behavior of the graph - it is designed to prevent the x-axis labels from being clipped. If you need to modify the spacing between the x-axis labels, I suggest you take a look at numberOfGapsBetweenLabelsOnLineGraph: delegate method and go from there.

@Sam-Spencer Sam-Spencer changed the title xAxis Labels uneven spacing Uneven X-Axis Label Spacing Jul 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants