timqian / chart.xkcd

xkcd styled chart lib
https://timqian.com/chart.xkcd/
MIT License
7.61k stars 200 forks source link

Color, Font Size, and CSS Related Customization Option #11

Closed Mobashir1995 closed 4 years ago

Mobashir1995 commented 4 years ago

There is no option to change Color, Font Size, Font Family, and other CSS Related Styles.

Chart JS and other Similar Plugin has those Options.

Can you add those options on this plugin?

timqian commented 4 years ago

Yeah, options to config chart is on my plan, should be finished in 1-2 weeks

peterbe commented 4 years ago
Screen Shot 2019-08-29 at 2 00 16 PM

I clearly need to figure out how to control the colors. What's curious is that I don't specify any colors yet the axis becomes white.

timqian commented 4 years ago

@peterbe I use d3-axis to draw the axis, it automatically changes color when background color changes I think. I will try to find time in the weekend to add options to update color and font.

What I can think of for now is the following options, any suggestions?

{
dataColors, // array of colors for different datasets
axisColor,
fontColor,
fontFamily,
titleSize,
labelSize,
}
peterbe commented 4 years ago

I would love a default color too. Then, for example, fontColor would be var fontColor = options.fontColor || options.defaulltColor || 'black'

timqian commented 4 years ago

dataColors and fontFamily options are added in v1.1

Screen Shot 2019-09-03 at 2 56 53 PM

While implementing axis and fontColors I think it might be better to implement a dark mode for chart.xkcd to make it easier to use.

Further discussions about dark mode - https://github.com/timqian/chart.xkcd/issues/21