function _renderStockChart()
970973
private function _renderContourChart($groupCount,$dimensions) {
		require_once('jpgraph_contour.php');

		$this->_renderCartesianPlotArea('intint');

		for($i = 0; $i < $groupCount; ++$i) {
			$this->_renderPlotContour($i);
		}
	}
1173
function () {
            var series = this,
              chart = series.chart,
              wasDirtyData = series.isDirtyData, // cache it here as it is set to false in render, but used after
              group = series.group,
              xAxis = series.xAxis,
              yAxis = series.yAxis;

            // reposition on resize
            if (group) {
                if (chart.inverted) {
                    group.attr({
                        width: chart.plotWidth,
                        height: chart.plotHeight
                    });
                }

                group.animate({
                    translateX: pick(xAxis && xAxis.left, chart.plotLeft),
                    translateY: pick(yAxis && yAxis.top, chart.plotTop)
                });
            }

            series.translate();
            if (series.setTooltipPoints) {
                series.setTooltipPoints(true);
            }
            series.render();

            if (wasDirtyData) {
                fireEvent(series, 'updatedData');
            }
        }
459130
function renderLegend() {
			itemX = initialItemX;
			itemY = y;
			offsetWidth = 0;
			lastItemY = 0;

			if (!legendGroup) {
				legendGroup = renderer.g('legend')
					.attr({ zIndex: 7 })
					.add();
			}


			// add each series or point
			allItems = [];
			each(series, function (serie) {
				var seriesOptions = serie.options;

				if (!seriesOptions.showInLegend) {
					return;
				}

				// use points or series for the legend item depending on legendType
				allItems = allItems.concat(seriesOptions.legendType === 'point' ?
					serie.data :
					serie
				);

			});

			// sort by legendIndex
			stableSort(allItems, function (a, b) {
				return (a.options.legendIndex || 0) - (b.options.legendIndex || 0);
			});

			// reversed legend
			if (reversedLegend) {
				allItems.reverse();
			}

			// render the items
			
			// PATCH by Simon Fishel
            //
            // call label render hook before rendering the legend items
            //
            // + if(hooks.labelRenderHook) {
            // +    hooks.labelRenderHook(allItems, options, itemStyle, spacingBox, renderer);
            // + }
            
            if(hooks.labelRenderHook) {
                hooks.labelRenderHook(allItems, options, itemStyle, spacingBox, renderer);
            }
			
			each(allItems, renderItem);



			// Draw the border
			legendWidth = widthOption || offsetWidth;
			legendHeight = lastItemY - y + itemHeight;

			if (legendBorderWidth || legendBackgroundColor) {
				legendWidth += 2 * padding;
				legendHeight += 2 * padding;

				if (!box) {
					box = renderer.rect(
						0,
						0,
						legendWidth,
						legendHeight,
						options.borderRadius,
						legendBorderWidth || 0
					).attr({
						stroke: options.borderColor,
						'stroke-width': legendBorderWidth || 0,
						fill: legendBackgroundColor || NONE
					})
					.add(legendGroup)
					.shadow(options.shadow);
					box.isNew = true;

				} else if (legendWidth > 0 && legendHeight > 0) {
					box[box.isNew ? 'attr' : 'animate'](
						box.crisp(null, null, null, legendWidth, legendHeight)
					);
					box.isNew = false;
				}

				// hide the border if no items
				box[allItems.length ? 'show' : 'hide']();
			}

			// 1.x compatibility: positioning based on style
			var props = ['left', 'right', 'top', 'bottom'],
				prop,
				i = 4;
			while (i--) {
				prop = props[i];
				if (style[prop] && style[prop] !== 'auto') {
					options[i < 2 ? 'align' : 'verticalAlign'] = prop;
					options[i < 2 ? 'x' : 'y'] = pInt(style[prop]) * (i % 2 ? -1 : 1);
				}
			}
			
			// PATCH by Simon Fishel
            // 
            // call placement hook before aligning the legend element
            //
            // + if(hooks.placementHook) {
            // +    hooks.placementHook(options, legendWidth, legendHeight, spacingBox);
            // + }
            
            if(hooks.placementHook) {
                hooks.placementHook(options, legendWidth, legendHeight, spacingBox);
            }

			if (allItems.length) {
				legendGroup.align(extend(options, {
					width: legendWidth,
					height: legendHeight
				}), true, spacingBox);
			}

			if (!isResizing) {
				positionCheckboxes();
			}
		}
984456
function () {
		var chart = this,
			spacing = chart.spacing,
			axisOffset,
			legend = chart.legend,
			margin = chart.margin,
			legendOptions = chart.options.legend,
			legendMargin = pick(legendOptions.margin, 10),
			legendX = legendOptions.x,
			legendY = legendOptions.y,
			align = legendOptions.align,
			verticalAlign = legendOptions.verticalAlign,
			titleOffset = chart.titleOffset;

		chart.resetMargins();
		axisOffset = chart.axisOffset;

		// Adjust for title and subtitle
		if (titleOffset && !defined(margin[0])) {
			chart.plotTop = mathMax(chart.plotTop, titleOffset + chart.options.title.margin + spacing[0]);
		}
		
		// Adjust for legend
		if (legend.display && !legendOptions.floating) {
			if (align === 'right') { // horizontal alignment handled first
				if (!defined(margin[1])) {
					chart.marginRight = mathMax(
						chart.marginRight,
						legend.legendWidth - legendX + legendMargin + spacing[1]
					);
				}
			} else if (align === 'left') {
				if (!defined(margin[3])) {
					chart.plotLeft = mathMax(
						chart.plotLeft,
						legend.legendWidth + legendX + legendMargin + spacing[3]
					);
				}

			} else if (verticalAlign === 'top') {
				if (!defined(margin[0])) {
					chart.plotTop = mathMax(
						chart.plotTop,
						legend.legendHeight + legendY + legendMargin + spacing[0]
					);
				}

			} else if (verticalAlign === 'bottom') {
				if (!defined(margin[2])) {
					chart.marginBottom = mathMax(
						chart.marginBottom,
						legend.legendHeight - legendY + legendMargin + spacing[2]
					);
				}
			}
		}

		// adjust for scroller
		if (chart.extraBottomMargin) {
			chart.marginBottom += chart.extraBottomMargin;
		}
		if (chart.extraTopMargin) {
			chart.plotTop += chart.extraTopMargin;
		}

		// pre-render axes to get labels offset width
		if (chart.hasCartesianSeries) {
			each(chart.axes, function (axis) {
				axis.getOffset();
			});
		}
		
		if (!defined(margin[3])) {
			chart.plotLeft += axisOffset[3];
		}
		if (!defined(margin[0])) {
			chart.plotTop += axisOffset[0];
		}
		if (!defined(margin[2])) {
			chart.marginBottom += axisOffset[2];
		}
		if (!defined(margin[1])) {
			chart.marginRight += axisOffset[1];
		}

		chart.setChartSize();

	}
306042
public function render()
    {
        $returnValue = $this->renderLabel();
        
        if (empty($this->value) === true) {
            // @todo should be in a blue info box.
            $returnValue .= "No values to display.";
        } elseif (($jsonObject = @json_decode($this->value)) === null) {
            // @todo should be in a red error box.
            $returnValue .= "Invalid value.";
        } else {
            // Valid JSON to be displayed.
            $returnValue .= "<ul class=\"json-object-list\">";
            
            foreach ($jsonObject as $jsonKey => $jsonValue) {
                $returnValue .= "<li>";
                
                $returnValue .= "<div class=\"widget-jsonobject-key\">" . _dh($jsonKey) . ":</div>";
                $returnValue .= "<div><input class=\"widget-jsonobject-value\" type=\"text\" disabled=\"disabled\" value=\"${jsonValue}\" /></</div>";
                
                $returnValue .= "</li>";
            }
            
            $returnValue .= "</ul>\n";
        }
        
        return $returnValue;
    }
384149
function (str, x, y, useHTML) {

		// declare variables
		var defaultChartStyle = defaultOptions.chart.style,
			wrapper;

		x = mathRound(pick(x, 0));
		y = mathRound(pick(y, 0));

		wrapper = this.createElement('text')
			.attr({
				x: x,
				y: y,
				text: str
			})
			.css({
				fontFamily: defaultChartStyle.fontFamily,
				fontSize: defaultChartStyle.fontSize
			});

		wrapper.x = x;
		wrapper.y = y;
		wrapper.useHTML = useHTML;
		return wrapper;
	}
381631
def render(self, data, div_id="chart", head=""):
        """"""
        if not self.is_valid_name(div_id):
            raise ValueError(
                "Name {} is invalid. Only letters, numbers, '_', and '-' are permitted ".format(
                    div_id))

        return Template(head + self.template).render(
            div_id=div_id.replace(" ", "_"),
            data=json.dumps(
                data, indent=4).replace("'", "\\'").replace('"', "'"))
55820
public function render()
    {
        $returnValue = $this->renderLabel();
        
        $returnValue .= "<select name='{$this->name}' id='{$this->name}' ";
        $returnValue .= $this->renderAttributes();
        $returnValue .= ">";
        if (! empty($this->emptyOption)) {
            $this->options = array_merge(array(
                ' ' => $this->emptyOption), $this->options);
        }
        foreach ($this->options as $optionId => $optionLabel) {
            $returnValue .= "<option value='{$optionId}' ";
            if ($this->value === $optionId) {
                $returnValue .= " selected='selected' ";
            }
            $returnValue .= ">" . _dh($optionLabel) . "</option>";
        }
        $returnValue .= "</select>";
        
        return (string) $returnValue;
    }
767142
function render_dashboard_widget() {
		$this->setup_feeds();
		if ( empty( $this->items ) || ! is_array( $this->items ) ) {
			return;
		}
		?>
		<style type="text/css">
			#themeisle ul li.ti-dw-recommend-item {
				padding-left: 7px;
				border-top: 1px solid #eee;
				margin-bottom: 0px;
				padding-top: 6px;
			}

			#themeisle h2.hndle {
				background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vc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ywyLjczLDAsMCwwLTIuMTEuOSwzLjE3LDMuMTcsMCwwLDAtLjgzLDIuMjZ2NC44MmEzLjQ1LDMuNDUsMCwwLDAsLjgzLDIuMzMsMi42MSwyLjYxLDAsMCwwLDIuMTEsMSwyLjgzLDIuODMsMCwwLDAsMi4xOC0xLDMuMzIsMy4zMiwwLDAsMCwuOS0yLjMzVjY3LjYzQTMuMDYsMy4wNiwwLDAsMCw1MS4wNiw2NS4zN1oiLz48L3N2Zz4=');
				background-repeat: no-repeat;
				background-position: 92% 50%;
				background-size: 30px;
			}

			#themeisle .inside {
				padding: 0;
			}

			.ti-feed-list {
				padding: 0 12px 5px;
				margin-bottom: 10px;
				border-bottom: 1px solid #eee;
			}

			.ti-dw-feed-item a {
				display: flex;
				align-items: center;
				margin-bottom: 5px;
				padding: 5px;
				transition: .2s ease;
				border-radius: 3px;
			}

			.ti-dw-feed-item a:hover {
				background-color: #f8f8f8;
			}

			.ti-dw-feed-item a:hover .ti-dw-date-container {
				opacity: .9;
			}

			.ti-dw-feed-item .ti-dw-month-container {
				margin-top: -5px;
				text-transform: uppercase;
				font-size: 10px;
				letter-spacing: 1px;
				font-weight: 700;
			}

			.ti-dw-feed-item .ti-dw-date-container {
				border-radius: 3px;
				transition: .2s ease;
				min-height: 35px;
				margin-right: 5px;
				min-width: 35px;
				text-align: center;
				border: 1px solid #2a6f97;
				color: #fff;
				background: #2ea2cc;
				display: flex;
				flex-direction: column;
				justify-content: center;
			}

			.ti-dw-footer {
				padding: 0 12px 5px;
				text-align: center;
			}

			.ti-dw-recommend-item {
				display: block;
			}

			.ti-dw-recommend-item span {
				color: #72777c;
			}

			.ti-dw-powered-by {
				font-size: 11px;
				margin-top: 3px;
				display: block;
				color: #72777c;
			}

			.ti-dw-powered-by span {
				font-weight: 600;
			}

		</style>
		<?php do_action( 'themeisle_sdk_dashboard_widget_before', $this->product ); ?>

		<ul class="ti-feed-list">
			<?php

			foreach ( $this->items as $item ) {
				?>
				<li class="ti-dw-feed-item">
					<a href="
						<?php
						echo add_query_arg(
							array(
								'utm_source'   => 'wpadmin',
								'utm_campaign' => 'feed',
								'utm_medium'   => 'dashboard_widget',
							),
							$item['link']
						);
						?>
						" target="_blank">
							<span class="ti-dw-date-container"><span
										class="ti-dw-day-container"><?php echo date( 'd', $item['date'] ); ?></span> <span
										class="ti-dw-month-container"><?php echo substr( date( 'M', $item['date'] ), 0, 3 ); ?></span></span><?php echo $item['title']; ?>
					</a>
				</li>
				<?php
			}
			?>
		</ul>
		<?php
		$recommend = apply_filters( 'themeisle_sdk_recommend_plugin_or_theme', array() );
		if ( ! is_array( $recommend ) || empty( $recommend ) ) {
			return;
		}

		$type = $recommend['type'];

		if ( ( 'theme' === $type && ! current_user_can( 'install_themes' ) ) ) {
			return;
		}
		if ( ( 'plugin' === $type && ! current_user_can( 'install_plugins' ) ) ) {
			return;
		}

		add_thickbox();
		$url = add_query_arg(
			[
				'theme' => $recommend['slug'],
			],
			network_admin_url( 'theme-install.php' )
		);

		if ( 'plugin' === $type ) {

			$url = add_query_arg(
				array(
					'tab'    => 'plugin-information',
					'plugin' => $recommend['slug'],
				),
				network_admin_url( 'plugin-install.php' )
			);
		}
		?>
		<div class="ti-dw-footer">
					<span class="ti-dw-recommend-item ">
							<span class="ti-dw-recommend"><?php echo apply_filters( 'themeisle_sdk_dashboard_popular_label', sprintf( 'Popular %s', ucwords( $type ) ) ); ?>
								: </span>
						<?php
						echo trim(
							str_replace(
								array(
									'lite',
									'Lite',
									'(Lite)',
									'(lite)',
								),
								'',
								$recommend['name']
							)
						);
						?>
						(<a class="thickbox open-plugin-details-modal"
							href="<?php echo $url . '&TB_iframe=true&width=600&height=500'; ?>"><?php echo apply_filters( 'themeisle_sdk_dashboard_install_label', 'Install' ); ?></a>)
					</span>
			<span class="ti-dw-powered-by"><span><?php echo apply_filters( 'themeisle_sdk_dashboard_widget_powered_by', esc_attr( sprintf( 'Powered by %s', $this->product->get_friendly_name() ) ) ); ?></span></span>
		</div>

		<?php

	}
634548
def render(self,
               data,
               chart_type,
               chart_package='corechart',
               options=None,
               div_id="chart",
               head=""):
        """"""
        if not self.is_valid_name(div_id):
            raise ValueError(
                "Name {} is invalid. Only letters, numbers, '_', and '-' are permitted ".format(
                    div_id))

        return Template(head + self.template).render(
            div_id=div_id.replace(" ", "_"),
            data=json.dumps(
                data, indent=4).replace("'", "\\'").replace('"', "'"),
            chart_type=chart_type,
            chart_package=chart_package,
            options=json.dumps(
                options, indent=4).replace("'", "\\'").replace('"', "'"))
325848
public static function chart($type='core')
	{
		if (isset(self::$loaded[__METHOD__][$type]))
		{
			return;
		}

		if ($type != 'core')
		{
			self::chart();
		}

		if ($type == 'core')
		{
			Asset::script('assets/flot/jquery.flot.min.js', true, true);
			Asset::script('assets/flot/jquery.flot.canvas.min.js', true, true);
			Asset::script('assets/flot/jquery.flot.time.min.js', true, true);
			Asset::script('assets/flot/jquery.flot.tooltip.min.js', true, true);
		}
		else
		{
			Asset::script('assets/flot/jquery.flot.' . $type . '.min.js', true, true);
		}

		self::$loaded[__METHOD__][$type] = true;

		return;
	}
1358202
function () {
		var legend = this,
			chart = legend.chart,
			renderer = chart.renderer,
			legendGroup = legend.group,
			allItems,
			display,
			legendWidth,
			legendHeight,
			box = legend.box,
			options = legend.options,
			padding = legend.padding,
			legendBorderWidth = options.borderWidth,
			legendBackgroundColor = options.backgroundColor;

		legend.itemX = legend.initialItemX;
		legend.itemY = legend.initialItemY;
		legend.offsetWidth = 0;
		legend.lastItemY = 0;

		if (!legendGroup) {
			legend.group = legendGroup = renderer.g('legend')
				.attr({ zIndex: 7 }) 
				.add();
			legend.contentGroup = renderer.g()
				.attr({ zIndex: 1 }) // above background
				.add(legendGroup);
			legend.scrollGroup = renderer.g()
				.add(legend.contentGroup);
		}
		
		legend.renderTitle();

		// add each series or point
		allItems = [];
		each(chart.series, function (serie) {
			var seriesOptions = serie.options;

			if (!seriesOptions.showInLegend || defined(seriesOptions.linkedTo)) {
				return;
			}

			// use points or series for the legend item depending on legendType
			allItems = allItems.concat(
					serie.legendItems ||
					(seriesOptions.legendType === 'point' ?
							serie.data :
							serie)
			);
		});

		// sort by legendIndex
		stableSort(allItems, function (a, b) {
			return ((a.options && a.options.legendIndex) || 0) - ((b.options && b.options.legendIndex) || 0);
		});

		// reversed legend
		if (options.reversed) {
			allItems.reverse();
		}

		legend.allItems = allItems;
		legend.display = display = !!allItems.length;

		// render the items
		each(allItems, function (item) {
			legend.renderItem(item); 
		});

		// Draw the border
		legendWidth = options.width || legend.offsetWidth;
		legendHeight = legend.lastItemY + legend.lastLineHeight + legend.titleHeight;
		
		
		legendHeight = legend.handleOverflow(legendHeight);

		if (legendBorderWidth || legendBackgroundColor) {
			legendWidth += padding;
			legendHeight += padding;

			if (!box) {
				legend.box = box = renderer.rect(
					0,
					0,
					legendWidth,
					legendHeight,
					options.borderRadius,
					legendBorderWidth || 0
				).attr({
					stroke: options.borderColor,
					'stroke-width': legendBorderWidth || 0,
					fill: legendBackgroundColor || NONE
				})
				.add(legendGroup)
				.shadow(options.shadow);
				box.isNew = true;

			} else if (legendWidth > 0 && legendHeight > 0) {
				box[box.isNew ? 'attr' : 'animate'](
					box.crisp(null, null, null, legendWidth, legendHeight)
				);
				box.isNew = false;
			}

			// hide the border if no items
			box[display ? 'show' : 'hide']();
		}
		
		legend.legendWidth = legendWidth;
		legend.legendHeight = legendHeight;

		// Now that the legend width and height are established, put the items in the 
		// final position
		each(allItems, function (item) {
			legend.positionItem(item);
		});

		// 1.x compatibility: positioning based on style
		/*var props = ['left', 'right', 'top', 'bottom'],
			prop,
			i = 4;
		while (i--) {
			prop = props[i];
			if (options.style[prop] && options.style[prop] !== 'auto') {
				options[i < 2 ? 'align' : 'verticalAlign'] = prop;
				options[i < 2 ? 'x' : 'y'] = pInt(options.style[prop]) * (i % 2 ? -1 : 1);
			}
		}*/

		if (display) {
			legendGroup.align(extend({
				width: legendWidth,
				height: legendHeight
			}, options), true, 'spacingBox');
		}

		if (!chart.isResizing) {
			this.positionCheckboxes();
		}
	}
1044249
public function render()
    {
        if (!$this->visible) {
            return;
        }

        parent::render();

        if ($this->stock_id === null) {
            $this->setFromStock('check-only', false);
        } else {
            $this->setFromStock($this->stock_id, false);
        }

        if ($this->content_type === null) {
            $this->content_type = 'text/plain';
        }

        if ((bool) $this->value) {
            $this->renderTrue();
        } else {
            $this->renderFalse();
        }
    }
478106
function (item) {
            var legend = this,
              chart = legend.chart,
              renderer = chart.renderer,
              options = legend.options,
              horizontal = options.layout === 'horizontal',
              symbolWidth = legend.symbolWidth,
              symbolPadding = options.symbolPadding,
              itemStyle = legend.itemStyle,
              itemHiddenStyle = legend.itemHiddenStyle,
              padding = legend.padding,
              itemDistance = horizontal ? pick(options.itemDistance, 20) : 0,
              ltr = !options.rtl,
              itemHeight,
              widthOption = options.width,
              itemMarginBottom = options.itemMarginBottom || 0,
              itemMarginTop = legend.itemMarginTop,
              initialItemX = legend.initialItemX,
              bBox,
              itemWidth,
              li = item.legendItem,
              series = item.series && item.series.drawLegendSymbol ? item.series : item,
              seriesOptions = series.options,
              showCheckbox = legend.createCheckboxForItem && seriesOptions && seriesOptions.showCheckbox,
              useHTML = options.useHTML;

            if (!li) { // generate it once, later move it

                // Generate the group box
                // A group to hold the symbol and text. Text is to be appended in Legend class.
                item.legendGroup = renderer.g('legend-item')
                  .attr({ zIndex: 1 })
                  .add(legend.scrollGroup);

                // Generate the list item text and add it to the group
                item.legendItem = li = renderer.text(
                  options.labelFormat ? format(options.labelFormat, item) : options.labelFormatter.call(item),
                  ltr ? symbolWidth + symbolPadding : -symbolPadding,
                    legend.baseline || 0,
                  useHTML
                  )
                  .css(merge(item.visible ? itemStyle : itemHiddenStyle)) // merge to prevent modifying original (#1021)
                  .attr({
                      align: ltr ? 'left' : 'right',
                      zIndex: 2
                  })
                  .add(item.legendGroup);

                // Get the baseline for the first item - the font size is equal for all
                if (!legend.baseline) {
                    legend.baseline = renderer.fontMetrics(itemStyle.fontSize, li).f + 3 + itemMarginTop;
                    li.attr('y', legend.baseline);
                }

                // Draw the legend symbol inside the group box
                series.drawLegendSymbol(legend, item);

                if (legend.setItemEvents) {
                    legend.setItemEvents(item, li, useHTML, itemStyle, itemHiddenStyle);
                }

                // Colorize the items
                legend.colorizeItem(item, item.visible);

                // add the HTML checkbox on top
                if (showCheckbox) {
                    legend.createCheckboxForItem(item);
                }
            }

            // calculate the positions for the next line
            bBox = li.getBBox();

            itemWidth = item.checkboxOffset =
              options.itemWidth ||
              item.legendItemWidth ||
              symbolWidth + symbolPadding + bBox.width + itemDistance + (showCheckbox ? 20 : 0);
            legend.itemHeight = itemHeight = mathRound(item.legendItemHeight || bBox.height);

            // if the item exceeds the width, start a new line
            if (horizontal && legend.itemX - initialItemX + itemWidth >
              (widthOption || (chart.chartWidth - 2 * padding - initialItemX - options.x))) {
                legend.itemX = initialItemX;
                legend.itemY += itemMarginTop + legend.lastLineHeight + itemMarginBottom;
                legend.lastLineHeight = 0; // reset for next line
            }

            // If the item exceeds the height, start a new column
            /*if (!horizontal && legend.itemY + options.y + itemHeight > chart.chartHeight - spacingTop - spacingBottom) {
             legend.itemY = legend.initialItemY;
             legend.itemX += legend.maxItemWidth;
             legend.maxItemWidth = 0;
             }*/

            // Set the edge positions
            legend.maxItemWidth = mathMax(legend.maxItemWidth, itemWidth);
            legend.lastItemY = itemMarginTop + legend.itemY + itemMarginBottom;
            legend.lastLineHeight = mathMax(itemHeight, legend.lastLineHeight); // #915

            // cache the position of the newly generated or reordered items
            item._legendItemPos = [legend.itemX, legend.itemY];

            // advance
            if (horizontal) {
                legend.itemX += itemWidth;

            } else {
                legend.itemY += itemMarginTop + itemHeight + itemMarginBottom;
                legend.lastLineHeight = itemHeight;
            }

            // the width of the widest item
            legend.offsetWidth = widthOption || mathMax(
                (horizontal ? legend.itemX - initialItemX - itemDistance : itemWidth) + padding,
                legend.offsetWidth
              );
        }
285733
function () {
            var chart = this,
              optionsChart = chart.options.chart,
              widthOption = optionsChart.width,
              heightOption = optionsChart.height,
              renderTo = chart.renderToClone || chart.renderTo;

            // get inner width and height from jQuery (#824)
            if (!defined(widthOption)) {
                chart.containerWidth = adapterRun(renderTo, 'width');
            }
            if (!defined(heightOption)) {
                chart.containerHeight = adapterRun(renderTo, 'height');
            }

            chart.chartWidth = mathMax(0, widthOption || chart.containerWidth || 600); // #1393, 1460
            chart.chartHeight = mathMax(0, pick(heightOption,
              // the offsetHeight of an empty container is 0 in standard browsers, but 19 in IE7:
              chart.containerHeight > 19 ? chart.containerHeight : 400));
        }
492698
function() {
			var me = this,
				ctx = me.ctx,
				valueOrDefault = helpers.getValueOrDefault,
				opts = me.options,
				globalDefaults = Chart.defaults.global;

			if (opts.display) {
				var fontSize = valueOrDefault(opts.fontSize, globalDefaults.defaultFontSize),
					fontStyle = valueOrDefault(opts.fontStyle, globalDefaults.defaultFontStyle),
					fontFamily = valueOrDefault(opts.fontFamily, globalDefaults.defaultFontFamily),
					titleFont = helpers.fontString(fontSize, fontStyle, fontFamily),
					rotation = 0,
					titleX,
					titleY,
					top = me.top,
					left = me.left,
					bottom = me.bottom,
					right = me.right,
					maxWidth;

				ctx.fillStyle = valueOrDefault(opts.fontColor, globalDefaults.defaultFontColor); // render in correct colour
				ctx.font = titleFont;

				// Horizontal
				if (me.isHorizontal()) {
					titleX = left + ((right - left) / 2); // midpoint of the width
					titleY = top + ((bottom - top) / 2); // midpoint of the height
					maxWidth = right - left;
				} else {
					titleX = opts.position === 'left' ? left + (fontSize / 2) : right - (fontSize / 2);
					titleY = top + ((bottom - top) / 2);
					maxWidth = bottom - top;
					rotation = Math.PI * (opts.position === 'left' ? -0.5 : 0.5);
				}

				ctx.save();
				ctx.translate(titleX, titleY);
				ctx.rotate(rotation);
				ctx.textAlign = 'center';
				ctx.textBaseline = 'middle';
				ctx.fillText(opts.text, 0, 0, maxWidth);
				ctx.restore();
			}
		}
329274
public function render()
    {
        if (!$this->visible) {
            return;
        }

        if ($this->value === null && $this->null_display_value !== null) {
            $span_tag = new SwatHtmlTag('span');
            $span_tag->class = 'swat-none';
            $span_tag->setContent($this->null_display_value);
            $span_tag->display();
        } else {
            parent::render();

            $locale = SwatI18NLocale::get($this->locale);
            $format = $this->getCurrencyFormat();

            echo SwatString::minimizeEntities(
                $locale->formatCurrency(
                    $this->value,
                    $this->international,
                    $format
                )
            );

            if (!$this->international && $this->display_currency) {
                echo '&nbsp;',
                    SwatString::minimizeEntities(
                        $locale->getInternationalCurrencySymbol()
                    );
            }
        }
    }