Highcharts chartWidth不再适用于chart.getSVG() [英] Highcharts chartWidth no longer works with chart.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屋!