Pre loader

Legend not showing - several NSLayoutConstraint conflicts (iOS)

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums


I am trying to add a legend to my chart similar to how is done in the LegendChartView.swift code in the sample app. However the legend does not show and I get several NSLayoutConstraints conflicts such as this one:

[LayoutConstraints] Unable to simultaneously satisfy constraints.   Probably at least one of the constraints in the following list is one you don't want.   Try this:       (1) look at each constraint and try to figure out which you don't expect;       (2) find the code that added the unwanted constraint or constraints and fix it.  (
    "<NSLayoutConstraint:0x283528af0 UIButton:0x13c52d840.height == 25   (active)>",
    "<NSLayoutConstraint:0x2835285f0 UIButton:0x13c52d840.bottom == UIView:0x13c545060.bottom - 4   (active)>",
    "<NSLayoutConstraint:0x2835285a0 V:|-(4)-[UIButton:0x13c52d840]   (active, names: '|':UIView:0x13c545060 )>",
    "<NSLayoutConstraint:0x283528b40 'UIIBSystemGenerated' ==   (active)>",
    "<NSLayoutConstraint:0x283528b90 'UIIBSystemGenerated' V:[UIView:0x13c545060]-(0)-|   (active, names: '|':SCIDefaultLegendItem:0x13c543f90 )>",
    "<NSLayoutConstraint:0x283529c20 'UIView-Encapsulated-Layout-Height' SCIDefaultLegendItem:0x13c543f90.height == 0   (active)>" )

Will attempt to recover by breaking constraint  <NSLayoutConstraint:0x283528af0 UIButton:0x13c52d840.height == 25   (active)>

The internal SCIDefaultLegendItems look to keep setting their width and height to 0 which causes conflicts with the underlying UIButton and UILabel components.

Any thoughts on how to get around this? My chart has four series. I have seen the article on drawing the legend outside the chart surface area however I do not want to do that.

Thank you!

  • You must to post comments

This issue is fixed in version I am no longer getting these constraint problems or the crash upon upgrading from 3.0 to 3.1.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.