Beispiel #1
0
    def __init__(self, **kwargs):
        super(HeatMap, self).__init__(**kwargs)
        if 'data' in kwargs:
            kwargs['graphics'] = kwargs['data']
        if not 'xLowerMargin' in kwargs:
            kwargs['xLowerMargin'] = 0.0
        if not 'yLowerMargin' in kwargs:
            kwargs['yLowerMargin'] = 0.0
        if not 'yUpperMargin' in kwargs:
            kwargs['yUpperMargin'] = 0.0
        if not 'xUpperMargin' in kwargs:
            kwargs['xUpperMargin'] = 0.0
        if not 'legendLayout' in kwargs:
            kwargs['legendLayout'] = LegendLayout.HORIZONTAL
        if not 'legendPosition' in kwargs:
            kwargs['legendPosition'] = LegendPosition(
                    position=LegendPosition.Position.BOTTOM_RIGHT)
        self.chart = XYChart(**kwargs)
        color = getValue(kwargs, 'color',
                         ["#FF780004", "#FFF15806", "#FFFFCE1F"])
        
        if isinstance(color, GradientColor):
            self.chart.color = color.color
        else:
            self.chart.color = color
        
        self.chart.type = 'HeatMap'

        self.model = self.chart.transform()
Beispiel #2
0
 def __init__(self, **kwargs):
   BaseObject.__init__(self)
   self.init_width = getValue(kwargs, 'initWidth', 640)
   self.init_height = getValue(kwargs, 'initHeight', 480)
   self.chart_title = getValue(kwargs, 'title')
   self.show_legend = getValue(kwargs, 'showLegend')
   self.use_tool_tip = getValue(kwargs, 'useToolTip', True)
   self.legend_position = getValue(kwargs, 'legendPosition', LegendPosition())
   self.legend_layout = getValue(kwargs, 'legendLayout', LegendLayout.VERTICAL)