使用AnyChart通过jpg/png导出图表图,得到一半的输出



Iam使用AnyChart*版本:7.9.0

当我生成报告时,它是用正确的数据生成的,并且它在屏幕上正确地打印(例如,图像1:渲染的图表取决于输出(,但当我以png/jpg导出绘图时,它将导出一半的输出,如图2中所示(导出的图表使用png/jpg格式(。

如何实现导出完整的图表。

呈现的图表取决于输出

使用png/jpg格式导出的图表

json代码:

{
"chart":{
"container":"dashboard:inqByProductsGraphPanalId_1",
"legend":null,
"legand":null,
"tooltip":{
"padding":null,
"allowLeaveScreen":false,
"offsetX":0,
"offsetY":0,
"anchor":"center",
"hideDelay":null,
"enabled":false,
"displayMode":null
},
"yScale":1,
"type":"column",
"title":{
"enabled":true,
"text":"Inquiry by Product",
"width":null,
"height":null,
"orientation":"top",
"align":"center",
"rotation":null,
"padding":{
"top":-10,
"right":0,
"bottom":30,
"left":0
},
"useHtml":true,
"fontSize":11,
"fontColor":"Black"
},
"fill":null,
"stroke":null,
"animation":{
"enabled":false
},
"labels":{
"enabled":true,
"useHtml":false,
"position":"centerTop",
"anchor":"centerBottom",
"fontColor":"Black",
"background":null,
"padding":{
"top":2,
"right":2,
"bottom":2,
"left":2
}
},
"crosshair":{
"xLabel":{
"anchor":"centerTop"
},
"yLabel":{
"anchor":"rightCenter"
}
},
"chartId":"100",
"series":[
{
"data":[
{
"fill":"DarkOliveGreen",
"x":"ADIDAS",
"value":19,
"weekNumber":0,
"year":0
},
{
"fill":"Crimson",
"x":"No Product Name Reported",
"value":44,
"weekNumber":0,
"year":0
},
{
"fill":"Chocolate",
"x":"ANACIN",
"value":24,
"weekNumber":0,
"year":0
},
{
"fill":"DarkMagenta",
"x":"AMLODOC",
"value":56,
"weekNumber":0,
"year":0
}
],
"labels":{
"enabled":true,
"useHtml":false,
"position":"centerTop",
"anchor":"centerBottom",
"fontColor":"Black",
"background":null,
"padding":{
"top":2,
"right":2,
"bottom":2,
"left":2
}
},
"name":null,
"enabled":true,
"seriesType":"column",
"type":null,
"color":null,
"xScale":0,
"yScale":1,
"selectFill":"Goldenrod",
"hatchFill":null,
"hoverHatchFill":"#445444",
"selectHatchFill":"Plum",
"select":null,
"tooltip":null
}
],
"xScale":0,
"scales":[
{
"type":"ordinal",
"inverted":false,
"names":[

],
"ticks":null
},
{
"type":"linear",
"inverted":false,
"maximum":null,
"minimum":null,
"minimumGap":"0.1",
"maximumGap":"0.1",
"softMinimum":null,
"softMaximum":null,
"stackMode":"none",
"stickToZero":"true",
"logBase":"10"
}
],
"interactivity":{
"selectionMode":"singleSelect",
"hoverMode":"byX",
"spotRadius":null
}
}
}

您使用的是库7.9.0的一个非常旧的版本。它与export.anychart.com上托管的导出服务器的当前版本不完全兼容(8.8.0(。要解决此问题,可以使用手动应用的映像大小调用saveAsJpg或saveAsPng函数。像这样:

chart.saveAsJpg(600, 600);

此外,您可以将库更新到最新版本,以避免不兼容问题。

最新更新