File: GChartExample00.py

package info (click to toggle)
pyjamas 0.7~%2Bpre2-3
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 10,656 kB
  • ctags: 12,331
  • sloc: python: 74,493; php: 805; sh: 291; makefile: 59; xml: 9
file content (20 lines) | stat: -rw-r--r-- 522 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

from pyjamas.chart.GChart import GChart

"""*
* Defines a scatter-plot of x*x vs. x.
"""
class GChartExample00(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.getXAxis().setAxisLabel("x")
        self.getYAxis().setAxisLabel("x<sup>2</sup>")