如何导出整个页面或HTML内容与Highcharts不仅仅是图表? [英] How to export the whole page or html content with Highcharts not just the chart?

查看:748
本文介绍了如何导出整个页面或HTML内容与Highcharts不仅仅是图表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好所有的图表都输出了高分辨率图表我的php项目获得图表

但问题是

我希望导入html内容或整个页面以及图表不只是图表



有可能吗?



任何人都可以帮助我



或者在这里展示一个样本小提琴 http://jsfiddle.net/YBXdq/



我需要导出图表下方的文字以及

解决方案

我为导出图表找到了一个简单的解决方法(打印) b
$ b



我没有使用任何插件只是简单的旧css和一些javascript



在我的情况下是

我想用页面的某些特定html内容打印图表



或在我的情况下,我想删除页眉,页脚和左菜单

我想显示按钮或不必要的内容



只显示页面内容,说明表和图表



所以这里是我如何实现它。


$ b

> CSS: strong>






 < style type =text / css> 
@media print {
@page
{
size:auto; / * auto是初始值* /
margin:0mm; / *这会影响打印机设置的边距* /
}
body {background-color:#FFFFFF;背景图像:无;颜色:#000000}
.navimainbg {display:none;}
.printhide {display:none;}
.usercontent-footer {display:none;}
.linkBTN {显示:无;}
.userheader {display:none;}
.user-profile-left {display:none;}
#userbgcontent {width:100%;}
}
< / style>

我们关注的是打印css,这是我们在打印页面时隐含的



访问您不希望根据您的使用情况通过他们的课程或ID打印的网页divs或部分。

b b 示例



我不想显示按钮

  .linkBTN { display:none;} 

可以简单地通过javascript调用。



Javascript: - >






 < script type =text / javascript> 


function printpage()
{

window.print()
}

我们可以调用print函数打印页面减去我们不想用页面打印的元素点击一个按钮通过调用函数在我的情况下打印页面,因为你可以
看到这个按钮也将不会显示,因为printhide类显示设置为无,而priting

 < input title =打印便于打印的页面class =printhidetype =buttonvalue =打印此页onclick =printpage()> ;如果你想打印更多 

$ b

只有在某些情况下,由于缺少尺寸以显示图像,图像会随着某些内容显示而滑落。它会转到下一页。除了它的测试工作。


hi all my chart is exporting fine with highcharts i m getting the chart for my php project

but the problem is

that i am looking to import html content or the whole page along with the chart not just the chart

is it possible to do ??

can any one help me

or show here is a sample fiddle http://jsfiddle.net/YBXdq/

i need to export the text below the chart has well

解决方案

i found a simple workaround for exporting charts (printing)

and

i didn't use any plugin just little plain old css and some javascript

which in my case is

i wanted to print the chart with some specific html content of the page

or in my case i wanted to remove header , footer and left menu

i dint wanted to show buttons or unecessary content

and just show the page content , description table and chart

so here is i how i achieved it.

> CSS :-


<style type="text/css">
@media print{
@page
        {
            size: auto;   /* auto is the initial value */
            margin: 0mm;  /* this affects the margin in the printer settings */
        }
  body{ background-color:#FFFFFF; background-image:none; color:#000000 }
  .navimainbg{ display:none;}
  .printhide{ display:none;}
  .usercontent-footer{ display:none;}
  .linkBTN{ display:none;}
  .userheader{ display:none;}
  .user-profile-left{ display:none;}
  #userbgcontent{ width:100%;}
}
</style>

We are focussing on the print css here which we implied when the page is printed

acess the divs or portions of the page which you dont want ot be printed via their class or id depending upon your usage

for example

i didnt wanted to display the button

 .linkBTN{ display:none;}

which can be simply called via javascript.

Javascript :->


<script type="text/javascript">


function printpage()
{

window.print()
}

<script type="text/javascript">

we can invoke the print function to print the page minus elements we dont want to print with the page via click of a button by calling function in my case "printpage" as you can see this button will also not display while printing as printhide class display is set to none while priting

<input title="Print a Printer Friendly Page" class ="printhide" type="button" value="Print this page" onclick="printpage()">

isnt is it a simple way to print chart other than highcharts printing if you want to print more

only con is that sometime the image will slide down when you want to show it along with some conetent due to lack of size to render an image . it will shift to next page . other than its tested working .

这篇关于如何导出整个页面或HTML内容与Highcharts不仅仅是图表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆