Ticket #29 (closed enhancement: fixed)

Opened 18 months ago

Last modified 17 months ago

Allow overriding the chart colors

Reported by: lgs Owned by: somebody
Priority: major Milestone: 0.5.0
Component: component1 Version:
Keywords: Cc:

Description

Many people want to use their own colors and not Pycha boring defaults, even when they are carefully choosen to looks nice.

So we want a system to let the user choose the colors. Such a system should try to enforce nice looking values using color theory but it also should allow the user to choose any color scheme, no matter how bad does it looks :-)

Change History

  Changed 18 months ago by aprzywecki@…

Matplotlib (another graphing library) let's you specify colors using:

colors = ('b', 'g', 'r') pie(colors=colors...)

The chart will then use blue, green, red, blue, green, red, etc. when it draws the slices of the pie. I don't think they use any "make all charts look beautiful" code :)

Adam

follow-up: ↓ 3   Changed 17 months ago by lgs

  • status changed from new to closed
  • resolution set to fixed

I've implemented a pretty flexible color scheme system. You just need to subclass pycha.color.ColorScheme?, which is a dict subclass itself. Your dict should have a key for each dataset and its value is the color used to paint that dataset.

Pycha provides 3 color schemes:

Many different color schemes can be implemented using this system, including your cyclic suggestion :-)

All the code is in trunk since [170]

in reply to: ↑ 2   Changed 17 months ago by lgs

Replying to lgs:

I've implemented a pretty flexible color scheme system. You just need to subclass pycha.color.ColorScheme?, which is a dict subclass itself. Your dict should have a key for each dataset and its value is the color used to paint that dataset. Pycha provides 3 color schemes: - GradientColorScheme?: paints with old nice pycha colors - FixedColorScheme?: paints with used specified colors

Typo here: used -> user

Note: See TracTickets for help on using tickets.