<?php
/**
* This file is part of the exporting module for Highcharts JS.
* www.highcharts.com/license
*
*
* Available POST variables:
*
* $tempName string The desired filename without extension
* $type string The MIME type for export.
* $width int The pixel width of the exported raster image. The height is calculated.
* $svg string The SVG source code to convert.
*/
// Options
define ('BATIK_PATH', 'batik-rasterizer.jar');
///////////////////////////////////////////////////////////////////////////////
ini_set('magic_quotes_gpc', 'off');
$type = $_POST['type'];
$svg = (string) $_POST['svg'];
$filename = (string) $_POST['filename'];
// prepare variables
if (!$filename) $filename = 'chart';
if (get_magic_quotes_gpc()) {
$svg = stripslashes($svg);
}
$tempName = md5(rand());
// allow no other than predefined types
if ($type == 'image/png') {
$typeString = '-m image/png';
$ext = 'png';
} elseif ($type == 'image/jpeg') {
$typeString = '-m image/jpeg';
$ext = 'jpg';
} elseif ($type == 'application/pdf') {
$typeString = '-m application/pdf';
$ext = 'pdf';
} elseif ($type == 'image/svg+xml') {
$ext = 'svg';
}
$outfile = "temp/$tempName.$ext";
if ($typeString) {
// size
if ($_POST['width']) {
$width = (int)$_POST['width'];
if ($width) $width = "-w $width";
}
// generate the temporary file
if (!file_put_contents("temp/$tempName.svg", $svg)) {
die("Couldn't create temporary file. Check that the directory permissions for
the /temp directory are set to 777.");
}
// do the conversion
$output = shell_exec("java -jar ". BATIK_PATH ." $typeString -d $outfile $width temp/$tempName.svg");
// catch error
if (!is_file($outfile) || filesize($outfile) < 10) {
echo "<pre>$output</pre>";
echo "Error while converting SVG";
}
// stream it
else {
header("Content-Disposition: attachment; filename=$filename.$ext");
header("Content-Type: $type");
echo file_get_contents($outfile);
}
// delete it
unlink("temp/$tempName.svg");
unlink($outfile);
// SVG can be streamed directly back
} else if ($ext == 'svg') {
header("Content-Disposition: attachment; filename=$filename.$ext");
header("Content-Type: $type");
echo $svg;
} else {
echo "Invalid type";
}
?>
没有合适的资源?快使用搜索试试~ 我知道了~
jQuery动感统计曲线生成插件
共44个文件
htm:33个
js:5个
png:2个
5星 · 超过95%的资源 需积分: 0 53 下载量 93 浏览量
2012-08-27
16:20:52
上传
评论 2
收藏 201KB RAR 举报
温馨提示
jQuery动感统计曲线生成插件。可以生成折线图、条形图、饼图等统计图表。并且生成的图有动态性。而且使用简单。推荐下载
资源推荐
资源详情
资源评论
收起资源包目录
jQuery动感统计曲线生成插件highcharts.rar (44个子文件)
codefans.net
highcharts
js
jquery.min.js 71KB
highcharts.src.js 197KB
highcharts.js 62KB
modules
exporting.js 6KB
exporting.src.js 14KB
index.htm 3KB
exporting-server
index.php 2KB
graphics
skies.jpg 42KB
snow.png 5KB
ico-arrow.gif 9KB
sun.png 4KB
examples
bar-stacked.htm 2KB
combo-dual-axes.htm 3KB
area-stacked.htm 2KB
line-labels.htm 2KB
pie-donut.htm 3KB
area-stacked-percent.htm 2KB
area-missing.htm 2KB
combo-multi-axes.htm 3KB
column-negative.htm 2KB
area-negative.htm 2KB
dynamic-click-to-add.htm 2KB
spline-inverted.htm 2KB
combo.htm 2KB
column-stacked.htm 2KB
line-ajax.htm 3KB
line-time-series.htm 12KB
column-stacked-percent.htm 2KB
area-inverted.htm 2KB
dynamic-update.htm 2KB
areaspline.htm 2KB
spline-plot-bands.htm 4KB
combo-regression.htm 2KB
column-parsed.htm 3KB
area-basic.htm 3KB
column-rotated-labels.htm 3KB
pie-basic.htm 2KB
line-basic.htm 2KB
bar-basic.htm 2KB
tokyo.json 68B
column-basic.htm 2KB
dynamic-master-detail.htm 15KB
spline-symbols.htm 2KB
scatter.htm 10KB
共 44 条
- 1
布飞
- 粉丝: 29
- 资源: 20
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页