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

Accessibility Support for (most) Chart types #3520

Merged
merged 19 commits into from
Jul 6, 2018

Commits on May 10, 2018

  1. Adds accessibility for Pie Charts. (ChartsOrg#1060)

    This commit makes PieChartView adhere to the UIAccessibility container
    protocol. See the Accessibility section marked for the methods. To allow
    conformance, 3 properties are added to IPieChartDataSet and
    PieChartDataSet that enable a more user friendly audio descriptionfor
    data elements. PieChartRenderer has a new private method
    createAccessibleElement() that populates the accessiblePieChartElements
    property, which in turn is used in PieChartView. Note that to prevent
    contextless audio descriptions, the default Chart Description header
    text was deleted in Description.swift since it is already an optional.
    mathewa6 committed May 10, 2018
    Configuration menu
    Copy the full SHA
    1691036 View commit details
    Browse the repository at this point in the history

Commits on May 12, 2018

  1. Formatting & cleanup in PieChartRenderer. (ChartsOrg#1060)

    Minor changes to spacing in PieChartRenderer.swift. Removed formatting
    and use of "self." to match library style.
    mathewa6 committed May 12, 2018
    Configuration menu
    Copy the full SHA
    2f00321 View commit details
    Browse the repository at this point in the history

Commits on May 14, 2018

  1. Added accessibility to base classes. (ChartsOrg#1060)

    Updated ChartViewBase, ChartData and ChartDataRendererBase to declare
    the primary properties required for accessibility support within the
    Charts library. This includes the UIAccessibility protocol methods
    within ChartViewBase and the internal accessibleChartElements property
    in the base renderer. ChartData also has 3 optional properties to allow
    proper formatting of audio.
    mathewa6 committed May 14, 2018
    Configuration menu
    Copy the full SHA
    74b418a View commit details
    Browse the repository at this point in the history

Commits on May 18, 2018

  1. Extended NSUIView to abstract Platform accessibility. (ChartsOrg#1060)

    Added accessibilityChildren to ChartViewBase which is a layer over both UIAccessibilityContainer and NSAccessibilityGroup protocols. Updated PieChartRenderer to use the platform agnostic NSUIAccessibilityElement. Added init() overrides in NSUIView declaration for macOS to add .list NSAccessibilityRole. Added Platform+Accessibility.swift which extends NSUIView with accessibility container and group protocols and also declares NSUIAccessibilityElement, which acts as an abstraction over NSAccessibilityElement and UIAccessibilityElement.
    mathewa6 committed May 18, 2018
    Configuration menu
    Copy the full SHA
    4adff89 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    557d0d3 View commit details
    Browse the repository at this point in the history
  3. Minor file structure & accessibility fix. (ChartsOrg#1060)

    Moved Platform+Accessibility.swift to Utils folder. Changed
    accessibleChartElements to be final since Renderer subclasses should not need to
    modify its working. Simply populating it in draw() functions will add
    basic accessibility.
    mathewa6 committed May 18, 2018
    Configuration menu
    Copy the full SHA
    2bfca15 View commit details
    Browse the repository at this point in the history

Commits on May 19, 2018

  1. Configuration menu
    Copy the full SHA
    bce41d3 View commit details
    Browse the repository at this point in the history

Commits on May 20, 2018

  1. Added accessibility for Bar charts. (ChartsOrg#1060)

    Created internal property accessibilityOrderedElements to make
    BarChartRenderer be composed of logically ordered accessible elements (See inline comments for details). Updated ChartDataRendererBase, PieChartRenderer and Platform+Accessibility with updated comments to reflect the platform agnostic NSUIAccessibilityElement's use.
    mathewa6 committed May 20, 2018
    Configuration menu
    Copy the full SHA
    b9f6a14 View commit details
    Browse the repository at this point in the history

Commits on May 21, 2018

  1. Added accessibility for Horizontal bars. (ChartsOrg#1060)

    Updated HorizontalBarChartRenderer to populate
    accessibilityOrderedElements, which in turn is used by the
    BarChartRenderer superclass to enable accessibility. Added minor note to
    BarChartRenderer's createAccesibleElement() for edge case where x-axis
    labels can be inaccurate if multiple data sets are present.
    mathewa6 committed May 21, 2018
    Configuration menu
    Copy the full SHA
    0b15b6e View commit details
    Browse the repository at this point in the history

Commits on May 27, 2018

  1. Added accessibility for Line charts. (ChartsOrg#1060)

    LineChartRenderer now has a private accessibilityOrderedElements nested array that is then used to populate accessibleChartElements. Do note that the nesting is unnecessary for now, but will be needed once a custom rotor is added. Also unlike most other renderers, LineChartRenderer's accessibleChartElements is populated in drawCircles(). This required moving the check for isDrawCirclesEnabled() after accessibleChartElements are populated.
    mathewa6 committed May 27, 2018
    Configuration menu
    Copy the full SHA
    44f7519 View commit details
    Browse the repository at this point in the history
  2. Added accessibility for Bubble charts. (ChartsOrg#1060)

    Updated BubbleChartRenderer to mirror LineChartRenderer's nested
    use of accessibilityOrderedElements to populate accessibleChartElements.
    Minor updates to comments in LineChartRenderer.
    mathewa6 committed May 27, 2018
    Configuration menu
    Copy the full SHA
    2329bd7 View commit details
    Browse the repository at this point in the history

Commits on May 29, 2018

  1. Added accessibility for Radar charts. (ChartsOrg#1060)

    Updated RadarChartRenderer with accessibility properties and calls in
    drawData and drawDataSet. Due to the unique spatial arrangement of radar
    charts, accessibleChartElements is populated by dataset, within which
    variables are ordered in decreasing order.
    mathewa6 committed May 29, 2018
    Configuration menu
    Copy the full SHA
    0a35b86 View commit details
    Browse the repository at this point in the history

Commits on Jun 18, 2018

  1. Configuration menu
    Copy the full SHA
    5a3cc22 View commit details
    Browse the repository at this point in the history
  2. Bug fixes in Bubble and Line Chart accessibility. (ChartsOrg#1060)

    Fixed crash due to incorrect use of maxEntryCountSet instead of dataSetCount
    in BubbleChartRenderer and LineChartRenderer's
    accessibilityCreateEmptyOrderedElements(). Updated BubbleChartRenderer's
    bubble accessibilityLabel to include percentage size of bubble based on
    maxSize property of IBubbleChartDataSet.
    mathewa6 committed Jun 18, 2018
    Configuration menu
    Copy the full SHA
    867a502 View commit details
    Browse the repository at this point in the history
  3. Added accessibility for CandleStick charts. (ChartsOrg#1060)

    Updated CandleStickChartRenderer to populate accessibleChartElements.
    Unlike most other renderers with multiple dataSet support, we do not
    attempt to order elements logically and hence dataSets are presented to
    VO in the same order they are drawn with the dataSet label acting as a
    separating heading.
    mathewa6 committed Jun 18, 2018
    Configuration menu
    Copy the full SHA
    99aadf5 View commit details
    Browse the repository at this point in the history

Commits on Jun 19, 2018

  1. Fixed accessibility frame calculation on macOS. (ChartsOrg#1060)

    Added a workaround for non updating accessibility frame when resizing
    windows and using Charts on macOS by using setAccessibilityFrameInParent() in Platform+Accessibility. See inline comments for details.
    mathewa6 committed Jun 19, 2018
    Configuration menu
    Copy the full SHA
    afaf9e5 View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2018

  1. Unified accessible header creation for renderers. (ChartsOrg#1060)

    Added createAccessibleHeader() to ChartRendererBase.swift that is used
    to create a descriptive header for all subclasses based on dataSet count
    and labels. RadarChartRenderer and PieChartRenderer updated to add
    dataSet label to each item and with documentation respectively.
    mathewa6 committed Jun 20, 2018
    Configuration menu
    Copy the full SHA
    c785766 View commit details
    Browse the repository at this point in the history
  2. Fixed incorrect accessibility frames for Bar chart. (ChartsOrg#1060)

    Added an offset to BarChartRenderer's barRect calculation in prepareBuffer() to prevent
    calculation of rects outside visible chart area, while still allowing
    automatic offset of the axis minima visually. This workaround is only
    used when using auto calculated y-axis minima and isn't used when a custom
    minimum is manually set.
    mathewa6 committed Jun 20, 2018
    Configuration menu
    Copy the full SHA
    a77b5ef View commit details
    Browse the repository at this point in the history

Commits on Jun 29, 2018

  1. Minor change to adhere to UIAccessibility docs. (ChartsOrg#1060)

    Updated return value for the index(of:) function to be NSNotFound in
    Platform+Accessibility's iOS section. This is as required by the
    documentation for UIAccessibilityContainer protocol.
    mathewa6 committed Jun 29, 2018
    Configuration menu
    Copy the full SHA
    71f5c34 View commit details
    Browse the repository at this point in the history