Permalink
Browse files

more gchart update

git-svn-id: https://pyjamas.svn.sourceforge.net/svnroot/pyjamas/trunk@1556 7a2bd370-bda8-463c-979e-2900ccfb811e
  • Loading branch information...
lkcl
lkcl committed Aug 30, 2009
1 parent d26ed9e commit 82a85cf5ee6c25eb8712cc168f2b30d8ffac678d
@@ -1,6 +1,6 @@
from GChartTestAppUtil import rnd
-from pyjamas.chart import GChartUtil
+from pyjamas.chart.HovertextChunk import formatAsHovertext
from pyjamas.chart.GChart import GChart
from pyjamas.chart import AnnotationLocation
from pyjamas.chart import SymbolType
@@ -43,7 +43,7 @@ def __init__(self):
self.getCurve().getSymbol().setBackgroundColor(barColors[iCurve])
self.getCurve().setLegendLabel(barLabels[iCurve])
self.getCurve().getSymbol().setHovertextTemplate(
- GChartUtil.formatAsHovertext(barLabels[iCurve] + " revenue=${y}"))
+ formatAsHovertext(barLabels[iCurve] + " revenue=${y}"))
self.getCurve().getSymbol().setModelWidth(1.0)
self.getCurve().getSymbol().setBorderColor("black")
self.getCurve().getSymbol().setBorderWidth(1)
@@ -1,7 +1,8 @@
import math
from pyjamas.chart.GChart import GChart
-from pyjamas.chart import GChartUtil
+from pyjamas.chart.HovertextChunk import formatAsHovertext
+
# GWT 1.4's Math class does not include JDK's
# Math.log10--so emulate it.
@@ -19,7 +20,7 @@ def __init__(self):
self.setChartTitle("<h2>2<sup>x</sup> vs x</h2>")
self.addCurve()
self.getCurve().getSymbol().setHovertextTemplate(
- GChartUtil.formatAsHovertext("${y}=2^${x}"))
+ formatAsHovertext("${y}=2^${x}"))
self.getCurve().setLegendLabel("<b>2<sup>x</sup></b>")
self.getCurve().getSymbol().setBackgroundColor("red")
self.getCurve().getSymbol().setBorderColor("black")
@@ -1,6 +1,5 @@
-
+from pyjamas.chart.HovertextChunk import formatAsHovertext
from pyjamas.chart.GChart import GChart
-from pyjamas.chart import GChartUtil
from pyjamas.chart import AnnotationLocation
from pyjamas.chart import SymbolType
@@ -39,7 +38,7 @@ def __init__(self):
AnnotationLocation.SOUTHEAST)
ht = "%s, %d%%" % (region[i], percent[i])
- ht = GChartUtil.formatAsHovertext(ht)
+ ht = formatAsHovertext(ht)
self.getCurve().getSymbol().setHovertextTemplate(ht)
self.getCurve().setLegendLabel(region[i])
self.getCurve().addPoint(0, 100-sum)
@@ -1,4 +1,4 @@
-from pyjamas.chart import GChartUtil
+from pyjamas.chart.HovertextChunk import formatAsHovertext
from pyjamas.chart.GChart import GChart
from pyjamas.chart import AnnotationLocation
from pyjamas.chart import SymbolType
@@ -49,7 +49,7 @@ def __init__(self):
self.getCurve().getSymbol().setFillSpacing(3)
self.getCurve().getSymbol().setFillThickness(3)
self.getCurve().getSymbol().setHovertextTemplate(
- GChartUtil.formatAsHovertext(pieTypes[i] + ", " +
+ formatAsHovertext(pieTypes[i] + ", " +
"%d%%" % round(100*pieMarketShare[i])))
self.getCurve().getSymbol().setPieSliceSize(pieMarketShare[i])
self.getCurve().getPoint().setAnnotationText(pieTypes[i])
@@ -1,4 +1,4 @@
-from pyjamas.chart import GChartUtil
+from pyjamas.chart.HovertextChunk import formatAsHovertext
from pyjamas.chart.GChart import GChart
class CurveNumberHoverParameterInterpreter:
@@ -43,7 +43,7 @@ def __init__(self):
self.setBorderWidth("0px")
self.setHoverParameterInterpreter(
CurveNumberHoverParameterInterpreter())
- template = GChartUtil.formatAsHovertext(
+ template = formatAsHovertext(
"Curve #${curveNumber}:<br>x=${x}, y=${y}")
for iCurve in range(3):
self.addCurve()
@@ -134,22 +134,22 @@ def onModuleLoad():
# }})
# To focus on a single test, simply use Eclipse's Source, Toggle comment
- #addChart(GChartExample00())
- #addChart(GChartExample00a())
+ addChart(GChartExample00())
+ addChart(GChartExample00a())
# addChart(GChartExample00b())
# addChart(GChartExample00c())
- #addChart(GChartExample01())
+ addChart(GChartExample01())
# addChart(GChartExample01a(3))
# addChart(GChartExample01a(0))
# addChart(GChartExample01b())
# addChart(GChartExample01c())
addChart(GChartExample02())
- #addChart(GChartExample03())
- #addChart(GChartExample04())
+ addChart(GChartExample03())
+ addChart(GChartExample04())
# addChart(GChartExample04a())
# addChart(GChartExample04b())
# addChart(GChartExample05())
- #addChart(GChartExample06())
+ addChart(GChartExample06())
addChart(GChartExample07())
# addChart(GChartExample08())
# addChart(GChartExample09())
@@ -160,12 +160,12 @@ def onModuleLoad():
# addChart(GChartExample11(2,1,False))
# addChart(GChartExample11(3,1,False))
# addChart(GChartExample12())
- #addChart(GChartExample14())
+ addChart(GChartExample14())
# addChart(GChartExample15())
# addChart(GChartExample15a())
# addChart(GChartExample15b())
# addChart(GChartExample16())
- #addChart(GChartExample17())
+ addChart(GChartExample17())
# addChart(GChartExample17a())
# addChart(GChartExample18())
# addChart(GChartExample18a())
@@ -179,8 +179,8 @@ def onModuleLoad():
# addChart(GChartExample23(False, True))
# addChart(GChartExample23(True, False))
# addChart(GChartExample23(True, True))
- #addChart(GChartExample24())
- #addChart(GChartExample25())
+ addChart(GChartExample24())
+ addChart(GChartExample25())
#DeferredCommand.add(Command() {
# def execute(self):
# RootPanel.get().add(GChartExample25())
@@ -390,7 +390,7 @@ def onModuleLoad():
#RootPanel.get().add(TestGChart57a())
#RootPanel.get().add(TestGChart58())
- #addChart(TestGChart00())
+ addChart(TestGChart00())
RootPanel().get("loadingMessage").setVisible(False)
@@ -22,14 +22,14 @@
from pyjamas.ui.HTML import HTML
import GChart
-from GChartUtil import htmlWidth, htmlHeight
+from pyjamas.chart.GChartUtil import htmlWidth, htmlHeight
-from GChartConsts import DEFAULT_FONT_COLOR
-from GChartConsts import DEFAULT_ANNOTATION_FONTSIZE
-from GChartConsts import DEFAULT_WIDGET_WIDTH_UPPERBOUND
-from GChartConsts import DEFAULT_WIDGET_HEIGHT_UPPERBOUND
-from GChartConsts import CHARHEIGHT_TO_FONTSIZE_UPPERBOUND
-from GChartConsts import CHARWIDTH_TO_FONTSIZE_UPPERBOUND
+from pyjamas.chart.GChartConsts import DEFAULT_FONT_COLOR
+from pyjamas.chart.GChartConsts import DEFAULT_ANNOTATION_FONTSIZE
+from pyjamas.chart.GChartConsts import DEFAULT_WIDGET_WIDTH_UPPERBOUND
+from pyjamas.chart.GChartConsts import DEFAULT_WIDGET_HEIGHT_UPPERBOUND
+from pyjamas.chart.GChartConsts import CHARHEIGHT_TO_FONTSIZE_UPPERBOUND
+from pyjamas.chart.GChartConsts import CHARWIDTH_TO_FONTSIZE_UPPERBOUND
"""
* Annotates (labels) a chart symbol. Users access this class via
@@ -22,7 +22,7 @@
from pyjamas.ui import HasHorizontalAlignment
from pyjamas.ui import HasVerticalAlignment
-from GChartUtil import validateMultipliers
+from pyjamas.chart.GChartUtil import validateMultipliers
# retrieves a location given its multipliers
def getAnnotationLocation(widthMultiplier, heightMultiplier):
@@ -24,38 +24,38 @@
import NumberFormat
import DateTimeFormat
import GChart
-import Double
+from pyjamas.chart import Double
import TickLocation
import AnnotationLocation
import Annotation
-from GChartConsts import DEFAULT_TICK_LOCATION
-from GChartConsts import DEFAULT_TICK_COUNT
-from GChartConsts import DEFAULT_WIDGET_WIDTH_UPPERBOUND
-from GChartConsts import DEFAULT_WIDGET_HEIGHT_UPPERBOUND
-from GChartConsts import DEFAULT_TICK_LABEL_FONT_COLOR
-from GChartConsts import DEFAULT_TICK_LABEL_FONTSIZE
-from GChartConsts import DEFAULT_TICK_LABEL_FONT_STYLE
-from GChartConsts import DEFAULT_TICK_LABEL_FONT_WEIGHT
-from GChartConsts import DEFAULT_TICK_LABEL_FORMAT
-from GChartConsts import DEFAULT_TICK_LENGTH
-from GChartConsts import DEFAULT_TICK_LOCATION
-from GChartConsts import DEFAULT_TICK_THICKNESS
-from GChartConsts import Y2TICKS_ID
-from GChartConsts import Y2GRIDLINES_ID
-from GChartConsts import Y2AXIS_ID
-from GChartConsts import YTICKS_ID
-from GChartConsts import YGRIDLINES_ID
-from GChartConsts import YAXIS_ID
-from GChartConsts import XTICKS_ID
-from GChartConsts import XGRIDLINES_ID
-from GChartConsts import XAXIS_ID
-from GChartConsts import TICK_CHARHEIGHT_TO_FONTSIZE_LOWERBOUND
-from GChartConsts import TICK_CHARWIDTH_TO_FONTSIZE_LOWERBOUND
-from GChartConsts import Y_AXIS
-from GChartConsts import Y2_AXIS
-
-from GChartUtil import htmlHeight, htmlWidth
+from pyjamas.chart.GChartConsts import DEFAULT_TICK_LOCATION
+from pyjamas.chart.GChartConsts import DEFAULT_TICK_COUNT
+from pyjamas.chart.GChartConsts import DEFAULT_WIDGET_WIDTH_UPPERBOUND
+from pyjamas.chart.GChartConsts import DEFAULT_WIDGET_HEIGHT_UPPERBOUND
+from pyjamas.chart.GChartConsts import DEFAULT_TICK_LABEL_FONT_COLOR
+from pyjamas.chart.GChartConsts import DEFAULT_TICK_LABEL_FONTSIZE
+from pyjamas.chart.GChartConsts import DEFAULT_TICK_LABEL_FONT_STYLE
+from pyjamas.chart.GChartConsts import DEFAULT_TICK_LABEL_FONT_WEIGHT
+from pyjamas.chart.GChartConsts import DEFAULT_TICK_LABEL_FORMAT
+from pyjamas.chart.GChartConsts import DEFAULT_TICK_LENGTH
+from pyjamas.chart.GChartConsts import DEFAULT_TICK_LOCATION
+from pyjamas.chart.GChartConsts import DEFAULT_TICK_THICKNESS
+from pyjamas.chart.GChartConsts import Y2TICKS_ID
+from pyjamas.chart.GChartConsts import Y2GRIDLINES_ID
+from pyjamas.chart.GChartConsts import Y2AXIS_ID
+from pyjamas.chart.GChartConsts import YTICKS_ID
+from pyjamas.chart.GChartConsts import YGRIDLINES_ID
+from pyjamas.chart.GChartConsts import YAXIS_ID
+from pyjamas.chart.GChartConsts import XTICKS_ID
+from pyjamas.chart.GChartConsts import XGRIDLINES_ID
+from pyjamas.chart.GChartConsts import XAXIS_ID
+from pyjamas.chart.GChartConsts import TICK_CHARHEIGHT_TO_FONTSIZE_LOWERBOUND
+from pyjamas.chart.GChartConsts import TICK_CHARWIDTH_TO_FONTSIZE_LOWERBOUND
+from pyjamas.chart.GChartConsts import Y_AXIS
+from pyjamas.chart.GChartConsts import Y2_AXIS
+
+from pyjamas.chart.GChartUtil import htmlHeight, htmlWidth
# these are used in formatting tick positions into tick labels:
NUMBER_FORMAT_TYPE = 0
@@ -20,12 +20,12 @@
import math
import GChart
-import Double
+from pyjamas.chart import Double
from Point import Point
from Symbol import Symbol
-from GChartConsts import Y2_AXIS
-from GChartConsts import N_PRE_SYSTEM_CURVES
+from pyjamas.chart.GChartConsts import Y2_AXIS
+from pyjamas.chart.GChartConsts import N_PRE_SYSTEM_CURVES
import GChartWidgets
Oops, something went wrong.

0 comments on commit 82a85cf

Please sign in to comment.