Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 28 lines (22 sloc) 0.928 kb
7981ac8 Example01 gchart
lkcl authored
1
2 from pyjamas.chart.GChart import GChart
3 from pyjamas.chart import SymbolType
4
5 """*
6 * Defines a bar-chart of x*x vs. x, with gridlines.
7 """
8 class GChartExample01(GChart):
9 def __init__(self):
10 GChart.__init__(self)
11 self.setChartTitle("<b>x<sup>2</sup> vs x</b>")
12 self.setChartSize(150, 150)
13 self.addCurve()
14 for i in range(10):
15 self.getCurve().addPoint(i,i*i)
16 self.getCurve().setLegendLabel("x<sup>2</sup>")
17 self.getCurve().getSymbol().setSymbolType(SymbolType.VBAR_SOUTH)
18 self.getCurve().getSymbol().setBackgroundColor("red")
19 self.getCurve().getSymbol().setBorderColor("black")
20 self.getCurve().getSymbol().setModelWidth(1.0)
21 self.getXAxis().setAxisLabel("<b>x</b>")
22 self.getXAxis().setHasGridlines(True)
23 self.getYAxis().setAxisLabel("<b>x<sup>2</sup></b>")
24 self.getYAxis().setHasGridlines(True)
25
26
27
Something went wrong with that request. Please try again.