Browse files

Example01 gchart

git-svn-id: https://pyjamas.svn.sourceforge.net/svnroot/pyjamas/trunk@1469 7a2bd370-bda8-463c-979e-2900ccfb811e
  • Loading branch information...
1 parent 9ac2904 commit 7981ac84265fb7dbb86386ecd1a837530611f35f lkcl committed Aug 28, 2009
View
27 examples/gcharttestapp/GChartExample01.py
@@ -0,0 +1,27 @@
+
+from pyjamas.chart.GChart import GChart
+from pyjamas.chart import SymbolType
+
+"""*
+* Defines a bar-chart of x*x vs. x, with gridlines.
+"""
+class GChartExample01(GChart):
+ def __init__(self):
+ GChart.__init__(self)
+ self.setChartTitle("<b>x<sup>2</sup> vs x</b>")
+ self.setChartSize(150, 150)
+ self.addCurve()
+ for i in range(10):
+ self.getCurve().addPoint(i,i*i)
+ self.getCurve().setLegendLabel("x<sup>2</sup>")
+ self.getCurve().getSymbol().setSymbolType(SymbolType.VBAR_SOUTH)
+ self.getCurve().getSymbol().setBackgroundColor("red")
+ self.getCurve().getSymbol().setBorderColor("black")
+ self.getCurve().getSymbol().setModelWidth(1.0)
+ self.getXAxis().setAxisLabel("<b>x</b>")
+ self.getXAxis().setHasGridlines(True)
+ self.getYAxis().setAxisLabel("<b>x<sup>2</sup></b>")
+ self.getYAxis().setHasGridlines(True)
+
+
+
View
5 examples/gcharttestapp/GChartTestApp.py
@@ -10,6 +10,7 @@
from TestGChart00 import TestGChart00
from GChartExample00 import GChartExample00
from GChartExample00a import GChartExample00a
+from GChartExample01 import GChartExample01
"""*
*
@@ -119,10 +120,10 @@ def onModuleLoad():
# To focus on a single test, simply use Eclipse's Source, Toggle comment
#addChart(GChartExample00())
- addChart(GChartExample00a())
+ #addChart(GChartExample00a())
# addChart(GChartExample00b())
# addChart(GChartExample00c())
- # addChart(GChartExample01())
+ addChart(GChartExample01())
# addChart(GChartExample01a(3))
# addChart(GChartExample01a(0))
# addChart(GChartExample01b())
View
1 library/pyjamas/chart/Axis.py
@@ -1850,7 +1850,6 @@ def limitsChanged(self):
""" similar to getTickText, except for the tick position """
def getTickPosition(self, c, iTick):
- result
if self.isHorizontalAxis:
result = c.getPoint(iTick).getX()

0 comments on commit 7981ac8

Please sign in to comment.