Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 93 lines (85 sloc) 2.557 kb
abcce90 more gchart update
lkcl authored
1 import GChartTestAppUtil
2 from pyjamas.chart.GChart import GChart
3 from pyjamas.chart import SymbolType
4
5 symbolTypes = [\
6 SymbolType.BOX_CENTER,
7 SymbolType.BOX_EAST,
8 SymbolType.BOX_NORTH,
9 SymbolType.BOX_NORTHEAST,
10 SymbolType.BOX_NORTHWEST,
11 SymbolType.BOX_SOUTH,
12 SymbolType.BOX_SOUTHEAST,
13 SymbolType.BOX_SOUTHWEST,
14 SymbolType.BOX_WEST,
15 SymbolType.HBAR_EAST,
16 SymbolType.HBAR_NORTHEAST,
17 SymbolType.HBAR_NORTHWEST,
18 SymbolType.HBAR_SOUTHEAST,
19 SymbolType.BOX_SOUTHWEST,
20 SymbolType.HBAR_WEST,
21 SymbolType.HBAR_NEXT,
22 SymbolType.HBAR_PREV,
23 SymbolType.NONE,
24 SymbolType.VBAR_NORTH,
25 SymbolType.VBAR_NORTHEAST,
26 SymbolType.VBAR_NORTHWEST,
27 SymbolType.VBAR_SOUTH,
28 SymbolType.VBAR_SOUTHEAST,
29 SymbolType.VBAR_SOUTHWEST,
30 SymbolType.VBAR_NEXT,
31 SymbolType.VBAR_PREV,
32 SymbolType.XGRIDLINE,
33 SymbolType.Y2GRIDLINE,
34 SymbolType.YGRIDLINE
35 ]
36 symbolNames = [ \
37 "BOX_CENTER",
38 "BOX_EAST",
39 "BOX_NORTH",
40 "BOX_NORTHEAST",
41 "BOX_NORTHWEST",
42 "BOX_SOUTH",
43 "BOX_SOUTHEAST",
44 "BOX_SOUTHWEST",
45 "BOX_WEST",
46 "HBAR_EAST",
47 "HBAR_NORTHEAST",
48 "HBAR_NORTHWEST",
49 "HBAR_SOUTHEAST",
50 "BOX_SOUTHWEST",
51 "HBAR_WEST",
52 "HBAR_NEXT",
53 "HBAR_PREV",
54 "NONE",
55 "VBAR_NORTH",
56 "VBAR_NORTHEAST",
57 "VBAR_NORTHWEST",
58 "VBAR_SOUTH",
59 "VBAR_SOUTHEAST",
60 "VBAR_SOUTHWEST",
61 "VBAR_NEXT",
62 "VBAR_PREV",
63 "XGRIDLINE",
64 "Y2GRIDLINE",
65 "YGRIDLINE"
66 ]
67
68 """* Simple chart that uses every possible symbol type."""
69 class TestGChart02 (GChart):
70 def __init__(self):
71 GChart.__init__(self, XChartSize=400,YChartSize=400) # bit bigger so 29 curve legend fits
72 self.setChartTitle(GChartTestAppUtil.getTitle(self))
73 self.setChartFootnotes("Check: Rendering consistent with SymbolType on legend.")
74 for i in range(len(symbolTypes)):
75 self.addCurve()
76 self.getCurve(i).addPoint(i, i)
77 self.getCurve(i).getSymbol().setSymbolType(symbolTypes[i])
78 self.getCurve(i).getSymbol().setHeight(7)
79 self.getCurve(i).getSymbol().setWidth(7)
3f9a436 more gchart update
lkcl authored
80 self.getCurve(i).setLegendLabel("%d %s " % (i, symbolNames[i]))
64eff55 @xtfxme find * -name '*.py' | xargs sed -i -r 's,\s+$,,'
xtfxme authored
81
abcce90 more gchart update
lkcl authored
82 self.setLegendFontSize(8)
83 self.getXAxis().setTickLabelFontSize(8)
84 self.getXAxis().setHasGridlines(True)
3f9a436 more gchart update
lkcl authored
85 self.getXAxis().setTickCount(len(symbolTypes))
abcce90 more gchart update
lkcl authored
86 self.getYAxis().setTickLabelFontSize(8)
87 self.getYAxis().setHasGridlines(True)
3f9a436 more gchart update
lkcl authored
88 self.getYAxis().setTickCount(len(symbolTypes))
64eff55 @xtfxme find * -name '*.py' | xargs sed -i -r 's,\s+$,,'
xtfxme authored
89
90
abcce90 more gchart update
lkcl authored
91
92
Something went wrong with that request. Please try again.