Skip to content

Area Chart not displaying correct colors in high contrast mode with theme set #15921

Description

@VasimPatel

Expected behaviour

When setting the colors field in the theme object & those colors should be reflected during high contrast mode.

i.e. the example here
https://www.highcharts.com/docs/chart-design-and-style/themes

The expected result of setting the highContrast theme under accessibility as that theme would be the correct colors showing up (as they would when I set those colors in chart.options.colors)

Actual behaviour

Setting the colors object does not update the colors. Instead all areas are white. I do have the ability to set them to be a singular other color by setting "color" in plotOptions, but is there a separate recommended approach for setting colors in high contrast mode? I'd like to set distinct colors to maintain the same user experience. The issue here #15040 looks related, but this is more specific to the functionality of the highContrastTheme option.

Live demo with steps to reproduce

  1. On windows set high contrast mode
  2. Reload chart
  3. Colors not correctly set.
    https://jsfiddle.net/otc4huem/

The fiddle is just a modified version of the example fiddle provided for a stacked area chart

Product version

HighCharts 9.1.2

Affected browser(s)

Edge latest version

Activity

  1. raf18seb commented on Jun 22, 2021

    @raf18seb
    Contributor

    Hi @VasimPatel, sorry for the late reply and thanks for reporting the issue.

    Seems like an issue with accessibility in Edge.
    Simplified demo: https://jsfiddle.net/BlackLabel/nr7gst92/

    FYI @oysteinmoseng

  2. VasimPatel commented on Jun 23, 2021

    @VasimPatel
    Author

    Hello,

    Yes it only happens in Edge. In chrome the high contrast mode does not change the colors or the chart (unable to apply any color changes at all in chrome under the high contrast theme). Is there any way to disable this functionality so the charts do not change in high contrast mode?

  3. raf18seb commented on Jun 24, 2021

    @raf18seb
    Contributor

    @VasimPatel,

    actually, it's not the Edge issue - it's the only browser the contrast mode is working correctly with.

    To change the colors in the Windows High Contrast Mode, you can use this property: https://api.highcharts.com/highcharts/accessibility.highContrastTheme

    Sample demo: https://jsfiddle.net/BlackLabel/rptya3h6/

    Pending for @oysteinmoseng comment

  4. oysteinmoseng commented on Jun 24, 2021

    @oysteinmoseng
    Member

    This is an issue with how we apply the high contrast mode theme. We really need to change this.

    The theme forces specific colors to be set on each series, from theme.plotOptions, which is unfortunately necessary since it needs to override other colors that may be set specifically on each series. Perhaps we can find a better solution for this.

    There is currently no way to turn off the high contrast theme, which there should be. We will of course add this.

    Note: You should probably be careful with setting specific colors in High contrast mode, since you don't know what color theme the user has set up and prefers. The user is able to set their own custom theme in High contrast mode. Some users may even use High contrast mode for low contrast, for example users with certain cognitive disabilities. By setting specific colors you could clash with the user's custom theme.

    Highcharts by default tries to use the colors defined by the user by referring to system colors instead of hardcoded values. If you run into cases where this is not appropriate it would be great to know, since we would want to change the default theme or behavior to handle the use case.

  5. msftedad commented on Feb 8, 2024

    @msftedad

    Hi team, Any update on this issue?

  6. oysteinmoseng commented on Feb 12, 2024

    @oysteinmoseng
    Member

    Hi @msftedad, we will prioritize investigating this issue.

  7. self-assigned this
    on Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions