Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Honestly, the easiest way is going to be to monkeypatch the TimeFormatter's _formats dictionary:</p> <pre><code>from enthought.chaco.scales.formatters import TimeFormatter TimeFormatter._formats['days'] = ('%d/%m', '%d%a',) </code></pre> <p>If you don't want to do this, then you need to subclass TimeFormatter. That's easy. What's more cumbersome is making all the existing scale systems that the chaco.scales package creates use your new subclass rather than the built-in TimeFormatter. If you look at scales.time_scale.TimeScale, it accepts a 'formatter' keyword argument in the constructor. So, at the bottom of time_scale.py, when the MDYScales list is built, you'd have to create your own:</p> <pre><code>EuroMDYScales = [TimeScale(day_of_month=range(1,31,3), formatter=MyFormatter()), TimeScale(day_of_month=(1,8,15,22), formatter=MyFormatter()), TimeScale(day_of_month=(1,15), formatter=MyFormatter()), TimeScale(month_of_year=range(1,13), formatter=MyFormatter()), TimeScale(month_of_year=range(1,13,3), formatter=MyFormatter()), TimeScale(month_of_year=(1,7), formatter=MyFormatter()), TimeScale(month_of_year=(1,), formatter=MyFormatter())] </code></pre> <p>Then, when you create the ScalesTickGenerator, you need to pass in these scales to the ScaleSystem:</p> <pre><code>euro_scale_system = CalendarScaleSystem(*(HMSScales + EuroMDYScales)) tick_gen = ScalesTickGenerator(scale=euro_scale_system) </code></pre> <p>Then you can create the axis, giving it this tick generator:</p> <pre><code>axis = PlotAxis(tick_generator = tick_gen) </code></pre> <p>HTH, sorry this is about a month lag. I don't really check StackOverflow very much. If you have other chaco questions, I'd recommend signing up on the chaco-users mailing list...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload