Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draw Horiztontal Line on Bar Chart #976

Closed
mrxprt opened this issue Apr 25, 2016 · 3 comments
Closed

Draw Horiztontal Line on Bar Chart #976

mrxprt opened this issue Apr 25, 2016 · 3 comments

Comments

@mrxprt
Copy link

mrxprt commented Apr 25, 2016

Hi ,

it's not an issue . am just wandering if i can draw a line horizontally on Bar Chart like that in image

confluence page_threshold line3

thanks

@dxclancy
Copy link

dxclancy commented Apr 25, 2016

It's a good idea to check the ChartDemo for questions like these. For instance, if you look at the LineChart1ViewContoller, you'll see that it has limit lines, which I think will accomplish what you want. Here's a snippet from the Demo that might help.

    ChartLimitLine *ll1 = [[ChartLimitLine alloc] initWithLimit:130.0 label:@"Upper Limit"];
    ll1.lineWidth = 4.0;
    ll1.lineDashLengths = @[@5.f, @5.f];
    ll1.labelPosition = ChartLimitLabelPositionRightTop;
    ll1.valueFont = [UIFont systemFontOfSize:10.0];

    ChartLimitLine *ll2 = [[ChartLimitLine alloc] initWithLimit:-30.0 label:@"Lower Limit"];
    ll2.lineWidth = 4.0;
    ll2.lineDashLengths = @[@5.f, @5.f];
    ll2.labelPosition = ChartLimitLabelPositionRightBottom;
    ll2.valueFont = [UIFont systemFontOfSize:10.0];

    ChartYAxis *leftAxis = _chartView.leftAxis;
    [leftAxis removeAllLimitLines];
    [leftAxis addLimitLine:ll1];
    [leftAxis addLimitLine:ll2];

@liuxuan30
Copy link
Member

yep, it's either limitline or guide line, both supported.

@mrxprt
Copy link
Author

mrxprt commented Apr 26, 2016

Extremely thank full , you are right i have to check the Demos but i was building a POC with a very Limited time , really you saved my day 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants