Highcharts chartWidth不再适用于chart.getSVG() [英] Highcharts chartWidth no longer works with chart.getSVG()

查看:664
本文介绍了Highcharts chartWidth不再适用于chart.getSVG()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

纠正我,如果我错了,但我可以发誓chart.chartWidth用于返回由getSVG()返回的确切的宽度属性。
我会解释。
说我定位一个div,强制图表通过视图源读取以下内容。
< svg xmlns =http://www.w3.org/2000/svgversion =1.1width =270height =300> $ b现在如果我调用 chart.highcharts()。chartWidth 我会得到270. Great !
但是,如果我然后调用 chart.highcharts()。getSVG()我会得到这是一个开头
< ; svg xmlns =http://www.w3.org/2000/svgversion =1.1width =400height =600>



我一直在使用并添加一个将多个图表合并为一个图表的导出函数,我通常需要进行一些缩放以使其看起来不错。该比例取决于最初呈现的大小,而不是默认值,现在它导致了一个巨大的问题。



不应该getSVG返回svg表示图表,因为它出现在html ?

解决方案

您是否试过 sourceWidth 缩放参数?


Correct me if I'm wrong but I could have sworn chart.chartWidth used to return the exact width attribute as returned by getSVG(). I'll explain. Say I target a div that forces a chart to render with the following as read via view source. <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="270" height="300">

Now if I call chart.highcharts().chartWidth I'll get 270. Great! But if I then call chart.highcharts().getSVG() I'll get this is an opening <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="400" height="600">

I've been using and adding to an export function that will combine multiple charts into a single and I typically need to do some scaling to get it to look nice. The scale is dependent on the originally rendered size, not the default and now it's causing a huge problem.

Shouldn't getSVG return svg representing the chart as it appears in html?

解决方案

Have you tried sourceWidth or scale parameter?

这篇关于Highcharts chartWidth不再适用于chart.getSVG()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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