Warning: Can't synchronize with the repository (Unsupported version control system "svn". Check that the Python support libraries for "svn" are correctly installed.)

Ticket #6 (closed enhancement: fixed)

Opened 5 years ago

Last modified 5 years ago

patch adds axis labels, rotate for tick labels and enables font options

Reported by: jae@… Owned by: lgs
Priority: major Milestone:
Component: component1 Version:
Keywords: Cc: jae@…

Description

This patch is adds several things.

It adds a rotate option for the x and y axis labels. Options takes degrees of rotation. Default options are to not rotate.

It also adds an option for x and y axis labels. They take into account rotation if it is used. The axis labels are bolded. They default to no label.

I added calls to enable the labelFont and labelFontSize options. I needed the font settings to enable bold fonts for the axis labels.

The code is all (except the default options) in the _renderAxis() method. This lengthens this method quite a bit and I would normally try to break this up into some smaller functions, but I thought it better for the patch to include it all in that one method.

This patch includes/supersedes ticket #5 which only included the rotate x axis label option.

Attachments

chart-rotate-label.diff (7.2 kB) - added by jae@… 5 years ago.
patch to chart.py
pie-v2.diff (0.9 kB) - added by jae@… 5 years ago.
pie.py patch (version 2)
chart-v2.diff (10.5 kB) - added by jae@… 5 years ago.
chart.py patch (version 2)

Change History

Changed 5 years ago by jae@…

patch to chart.py

Changed 5 years ago by jae@…

  • cc jae@… added

I've updated my patch some more. Fixing a couple small issues and adding the rest of the features we need that require changes to pycha.

Differences from my last patch are...

- includes patch #7 (y-axis ticks issue). - More options for finer grained control of background rendering. - Option for setting image/surface background (rather than just chart

background).

- Changes to pie.py to use new background options. - Fixes for a couple places were labelHeight was used where the font

ascent was needed.

- Added optional chart title with corresponding text, font and font size

options.

I tried to follow your coding conventions where possible and I purposely made all the changes to the existing methods to (hopefully) make them easier to understand by keeping the context more consistent.

I'll upload the changes as 2 patches. 1 for each effected file (chart.py and pie.py).

Changed 5 years ago by jae@…

pie.py patch (version 2)

Changed 5 years ago by jae@…

chart.py patch (version 2)

Changed 5 years ago by lgs

  • owner changed from somebody to lgs
  • status changed from new to assigned

The functionality for adding titles to the chart is commited in [80]. Thanks for your patch.

Changed 5 years ago by lgs

The functionality for drawing the whole background in a different color than the chart background is commited in [81]

Changed 5 years ago by lgs

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

I commited the rest of your patch (the part for rotating ticks and drawing label axis) in [82]. I have refactored your patch to split it in several methods for increasing the readibility.

Note: See TracTickets for help on using tickets.