diff --git a/Child Labor/countries_2016.xml b/Child Labor/countries_2016.xml index f94a324..c4e77e6 100644 --- a/Child Labor/countries_2016.xml +++ b/Child Labor/countries_2016.xml @@ -33942,7 +33942,7 @@ addressing-labor-exploitation-fishing-asean Yes Yes Yes - NO + No Unknown Unknown Unknown diff --git a/charts/AssesmentLevelParser.swift b/charts/AssesmentLevelParser.swift index cfb34bd..857be53 100644 --- a/charts/AssesmentLevelParser.swift +++ b/charts/AssesmentLevelParser.swift @@ -62,18 +62,25 @@ class AssesmentLevelParser { for country in goodsXML[kCountries][kCountry].all { if let countryRegion = country["Region"].element?.text, !countryRegion.isEmpty { - - if var enforcements = country["Enforcements"]["Labor_Inspectors_Intl_Standards"].element?.text, !enforcements.isEmpty { + var enforcementss = "" + if var enforcement = country["Enforcements"]["Labor_Inspectors_Intl_Standards"]["Territory"]["Enforcement"].element?.text { + enforcementss = enforcement + } else { + if var enforcements = country["Enforcements"]["Labor_Inspectors_Intl_Standards"].element?.text, !enforcements.isEmpty { + enforcementss = enforcements + } + } + if enforcementss.count > 0 { if var currentSector = self.goodsSectors[countryRegion] as? Dictionary { - if var advancementInfo = currentSector[enforcements] as? Int { + if var advancementInfo = currentSector[enforcementss] as? Int { advancementInfo += 1 - currentSector[enforcements] = advancementInfo + currentSector[enforcementss] = advancementInfo } else { - currentSector[enforcements] = 1 + currentSector[enforcementss] = 1 } self.goodsSectors[countryRegion] = currentSector } else { - self.goodsSectors[countryRegion] = [enforcements : 1] + self.goodsSectors[countryRegion] = [enforcementss : 1] } } } diff --git a/charts/AssesmentsPageViewController.swift b/charts/AssesmentsPageViewController.swift index c5de237..fb27c33 100644 --- a/charts/AssesmentsPageViewController.swift +++ b/charts/AssesmentsPageViewController.swift @@ -133,11 +133,20 @@ class AssesmentsPageViewController: UIPageViewController { if let regionAssesmentsDict = assesmentData[key] as? [String : Any] { var chartSegments = [Segment]() for assesmentKey in regionAssesmentsDict.keys { - let assesmentSegment = Segment.init(color: colorCodes[assesmentKey] ?? .gray, value: CGFloat(regionAssesmentsDict[assesmentKey] as! Int), title : assesmentKey, isFloatType: false) - chartSegments.append(assesmentSegment) + if !assesmentKey.contains("\n") { + let assesmentSegment = Segment.init(color: colorCodes[assesmentKey] ?? .gray, value: CGFloat(regionAssesmentsDict[assesmentKey] as! Int), title : assesmentKey, isFloatType: false) + chartSegments.append(assesmentSegment) + } + } - let chartDetails = AssesmentPageDetails(name: key, mainTitle: "Advancement Level for \(key)", index: index, chartData: chartSegments) - advancementsArr.append(chartDetails) + if screenType == .assesmentLevelByRegion { + let chartDetails = AssesmentPageDetails(name: key, mainTitle: "Advancement Level for \(key)", index: index, chartData: chartSegments) + advancementsArr.append(chartDetails) + } else if screenType == .newDVASCountries { + let chartDetails = AssesmentPageDetails(name: key, mainTitle: "Assessment Level for \(key)", index: index, chartData: chartSegments) + advancementsArr.append(chartDetails) + } + } }