Closed jarib closed 9 years ago
I would be open to this being rolled into a chart theming feature, but I'm hesitant to allow arbitrary background color changes.
Why does an end user need to change the background color?
This could also be achieved by customizing the styles on the chart sizes. e.g. a gray background if "spot chart" is selected
It doesn't need to be arbitrary colors, we could use the same palette as currently exists for line/columns/dots, or a separate restricted pallette for background colors.
A user may want to customize the background color for the same reason they want to customize any other color - to make it fit visually with their brand / context. E.g. in the news outlet I work for, we have a different background color for the sports section. It would be nice for them to create charts that doesn't looks different from everything else in their section.
If there's a theming feature planned, that may very well solve this problem.
sorry for the slow reply on this.
I think the best thing for us to do would be to create some sort of theming eg. Sports Section themed, or Opinion themed, etc.
In the meantime you could create a light version of this by styling by chart size. eg. Create "Sports-Spot" "Sports-Medium" "Opinion-Spot" "Opinion-Medium" options and styling the css appropriately by targeting that selector
Hi,
Sorry to open this issue again, but I would like to try this solution, but I'm not sure which file I should edit. For example, if I want a background in blue for the smallSpot. Could you help me? Thanks in advance!
Hi @fdaudens, no worries, you could add a style definition like this
.small
rect.svg-background, .d4 .axis .tick rect
fill midnightblue
or make your customizations in a separate file and @import
them in src/styl/main.styl
Thank you for your reply @yanofsky ! I've tried this solution, but it doesn't seem to work with the small size.
.small
rect.svg-background, .d4 .axis .tick rect
fill midnightblue
.em-size
font-size $em_size_small
.d4
font-size $em_size_small
However, when I try with the medium size, it works (but it becomes blue for every size).
.medium
rect.svg-background, .d4 .axis .tick rect
fill midnightblue
.em-size
font-size $em_size
.d4
font-size $em_size
Any idea why?
Would be great if users could set the background color of the chart through the UI.