diff --git a/src/graph_ZCA/app.py b/src/graph_ZCA/app.py --- a/src/graph_ZCA/app.py +++ b/src/graph_ZCA/app.py @@ -1,7 +1,7 @@ from zope.interface import implements -from graph_ZCA.components import BaseComponent, Image, Axis, AxisComponent, ViewBox +from graph_ZCA.components import BaseComponent, Image, Axis, AxisComponent, ViewBox, TickLabelComponent from graph_ZCA.interfaces import IAxis, IViewBox, IBaseComponent from zope.component import getGlobalSiteManager, adapts @@ -49,6 +49,17 @@ class NewAxisComponent(AxisComponent): gsm.registerAdapter(NewAxisComponent) + +class NewTickLabelComponent(TickLabelComponent): + adapts(IAxis) + + def render(self): + return " ".join([ "q%i" % i for i in range(self.axis.start, self.axis.end)]) + +gsm.registerAdapter(NewTickLabelComponent) + + + image_data = [1,2,3,4] plot = PlotImage( None)