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

Provide a way of changing the theme without the need of explicit injection of the entire theme #89

Closed
gatapia opened this issue Nov 9, 2018 · 6 comments

Comments

@gatapia
Copy link

gatapia commented Nov 9, 2018

I think it would be great to be able to change the chart themes using highcharts-angular without requiring copy/paste of the entire theme file from the node_modules folder.

Something like adding the theme js file in the scripts array of the angular.json file would be great. This currently does not work.

@KacperMadej
Copy link
Contributor

Themes should be possible to load the same way as a module based on the file structure - https://unpkg.com/highcharts@6.2.0/themes/dark-unica.js (here's how a theme looks when loaded from NPM/NodeJS), so use this docs: https://github.com/highcharts/highcharts-angular#to-load-a-module

You need entire theme to set it, half of it will only apply half of the changes - I probably missed something in your comment, please provide more info for the issue.

@gatapia
Copy link
Author

gatapia commented Nov 13, 2018

Just tried this and it works as expected. Thanks, and apologies for redundant issue, perhaps add to documentation. Asked on stackoverflow and no one seemed to know either.

@gatapia gatapia closed this as completed Nov 13, 2018
@KacperMadej
Copy link
Contributor

KacperMadej commented Nov 14, 2018

Ok, thank's for the suggestion.

Marking the issue as an enhancement suggestion.

To-do list:

  • required: add docs for adding themes - FAQ sections
  • optional: ?styled mode info in docs - FAQ section?

@sebastianbochan
Copy link

sebastianbochan commented Nov 14, 2018

In the next release of highcharts, we will publish themes as scss files in the npm.

Related topic:

Regarding to the second point of check list: https://www.highcharts.com/docs/chart-design-and-style/custom-themes-in-styled-mode

@TitaneBoy
Copy link

Hi everyone..I'm trying to apply an existing theme in Highcharts but I just don't understand How to do this...For example, in "node_modules/highcharts/js/es-modules/themes/", there is multiple themes. If I want to use one of them (for example, dark-unica.js) in my custom component, How can I do it ?

Thank you in advance for you answer

@gatapia
Copy link
Author

gatapia commented Dec 7, 2018

Instructions given above by @KacperMadej is the way. I also updated my question stackoverflow with instructions

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

No branches or pull requests

4 participants