{
    "componentChunkName": "component---src-templates-doc-page-jsx",
    "path": "/javascript-data-grid/integrated-charts-api-downloading-image/",
    "result": {"data":{"markdownRemark":{"htmlAst":{"type":"root","children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"This section shows how to download charts via the Chart Toolbar and Grid API."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"downloading-charts-via-chart-toolbar","style":"position:relative;"},"children":[{"type":"text","value":"Downloading Charts via Chart Toolbar"},{"type":"element","tagName":"a","properties":{"href":"#downloading-charts-via-chart-toolbar","ariaLabel":"downloading charts via chart toolbar permalink","className":["docs-header-icon","after"]},"children":[{"type":"element","tagName":"svg","properties":{"id":"icon","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 32 32"},"children":[{"type":"element","tagName":"path","properties":{"d":"M29.25,6.76a6,6,0,0,0-8.5,0l1.42,1.42a4,4,0,1,1,5.67,5.67l-8,8a4,4,0,1,1-5.67-5.66l1.41-1.42-1.41-1.42-1.42,1.42a6,6,0,0,0,0,8.5A6,6,0,0,0,17,25a6,6,0,0,0,4.27-1.76l8-8A6,6,0,0,0,29.25,6.76Z"},"children":[]},{"type":"element","tagName":"path","properties":{"d":"M4.19,24.82a4,4,0,0,1,0-5.67l8-8a4,4,0,0,1,5.67,0A3.94,3.94,0,0,1,19,14a4,4,0,0,1-1.17,2.85L15.71,19l1.42,1.42,2.12-2.12a6,6,0,0,0-8.51-8.51l-8,8a6,6,0,0,0,0,8.51A6,6,0,0,0,7,28a6.07,6.07,0,0,0,4.28-1.76L9.86,24.82A4,4,0,0,1,4.19,24.82Z"},"children":[]}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Users can use the 'Download Chart' "},{"type":"element","tagName":"a","properties":{"href":"/archive/29.3.1/integrated-charts-toolbar/"},"children":[{"type":"text","value":"Chart Toolbar"}]},{"type":"text","value":" item to download the rendered\nchart in the browser."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"style":"display: flex; margin-bottom: 25px; margin-top: 25px; margin-left: 40px;"},"children":[{"type":"text","value":"\n    "},{"type":"element","tagName":"div","properties":{"style":"flex: 1 1 0"},"children":[{"type":"text","value":"\n        "},{"type":"element","tagName":"span","properties":{"className":["gatsby-resp-image-wrapper"],"style":"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 104px; "},"children":[{"type":"text","value":"\n      "},{"type":"element","tagName":"a","properties":{"className":["gatsby-resp-image-link"],"href":"/archive/29.3.1/static/43b2c99e21dc8a79b82589264808d1b2/609c6/chart-toolbar-download.png","style":"display: block","target":"_blank","rel":["noopener"]},"children":[{"type":"text","value":"\n    "},{"type":"element","tagName":"span","properties":{"className":["gatsby-resp-image-background-image"],"style":"padding-bottom: 222.1153846153846%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAsCAYAAABloJjNAAAACXBIWXMAAAsTAAALEwEAmpwYAAAC40lEQVRIx81WTU/jMBDtr+6dI0fEASohPgQcupyQ4MBl+QULbFtA7B6gLOpuBZQmzZft2A+NUxcnOJC0HNbSyPYb93XGz564gaptZQVot4HjY+DoCDg8BE5OgKUl4OVFL5kEIRpKKdhGTUqJOI6RJAw8YRm2tQU55R4mCdLpWB0cQD486LHnTdAwARgyalfX1+h0uuhdXuLi/BwJ+TY3oYIAUgj8vrlBMBplv9vbgxoMMkLfQUh9t9fDxc8OOt0ezn6cIU5TYHsbYAxhFOH76Sn+3PWz9fv7bkKbVAiBIAgRxTHiKMp86+uQjGHw+ISrm1+4vb1DTI7dXSiTclmEyP8LNLKzA7W6CtZqQbRaYGtrkBsbwPKy3gonoU2aE8qQCgFQ+mRS6jnhJgTPD/IpO5shm/ZFgxVIZcJZX2I5wmJ6day4VdUi/DD4vJCakG5Fmqa1rTRCctK545wjoSs1nRujOeHkt32fpkwgLXQ1wimTSinbBYGiKJ7DIuGnonw54ZenTAuN0owx7TQYGc0JN8rauDNCoxr9KIqimeLGaE7Flvy2b+GU31WhhVTm/4PKRcJiBa91sI16ZRGaa1ep2hjlSEVS01bYmFHZxlzkCx1sl+r+JJxfFP0bpZAwlj0IhMDTaFxOWCaKTRhGMR6fnvWLwfcnGPwdLhYhERIR1/vL8Dx6cR8b14ff3kObcDz2IFLypzrauVSmsSYMI/3CGA7/od/vY+z5VVPmzpTp+ca5wLd2Wz+qgjCqf1NyeziLcIj7+1oRloui91BYe1it2vD6Ks/zCZidQ99/O4e2ymUVm/BixXbelOfxW7UpflPs/qNq8+4uL/rVc1Vs/dSTUirOucrWvTWaCyG03+Wzx54fKCKksISUUnA6pYAgzFgWoND+oq+4zvMDUana8MKxKfsUmJSbAJpSyibnXI8NZnohhPbbmG0G8/ygSYQkDL0gGkmS6LHBTE94mqY5zDaDeX7QeAWsx2DADkXrTAAAAABJRU5ErkJggg=='); background-size: cover; display: block;"},"children":[]},{"type":"text","value":"\n  "},{"type":"element","tagName":"img","properties":{"className":["gatsby-resp-image-image"],"alt":"Chart Toolbar Download button","title":"Chart Toolbar Download button","src":"/archive/29.3.1/static/43b2c99e21dc8a79b82589264808d1b2/609c6/chart-toolbar-download.png","srcSet":["/archive/29.3.1/static/43b2c99e21dc8a79b82589264808d1b2/609c6/chart-toolbar-download.png 104w"],"sizes":["(max-width:","104px)","100vw,","104px"],"style":"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;","loading":"lazy","decoding":"async"},"children":[]},{"type":"text","value":"\n  "}]},{"type":"text","value":"\n    "}]},{"type":"text","value":"\n    "}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Note that the downloaded chart image will be in a "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"PNG"}]},{"type":"text","value":" format."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"downloading-charts-via-grid-api","style":"position:relative;"},"children":[{"type":"text","value":"Downloading Charts via Grid API"},{"type":"element","tagName":"a","properties":{"href":"#downloading-charts-via-grid-api","ariaLabel":"downloading charts via grid api permalink","className":["docs-header-icon","after"]},"children":[{"type":"element","tagName":"svg","properties":{"id":"icon","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 32 32"},"children":[{"type":"element","tagName":"path","properties":{"d":"M29.25,6.76a6,6,0,0,0-8.5,0l1.42,1.42a4,4,0,1,1,5.67,5.67l-8,8a4,4,0,1,1-5.67-5.66l1.41-1.42-1.41-1.42-1.42,1.42a6,6,0,0,0,0,8.5A6,6,0,0,0,17,25a6,6,0,0,0,4.27-1.76l8-8A6,6,0,0,0,29.25,6.76Z"},"children":[]},{"type":"element","tagName":"path","properties":{"d":"M4.19,24.82a4,4,0,0,1,0-5.67l8-8a4,4,0,0,1,5.67,0A3.94,3.94,0,0,1,19,14a4,4,0,0,1-1.17,2.85L15.71,19l1.42,1.42,2.12-2.12a6,6,0,0,0-8.51-8.51l-8,8a6,6,0,0,0,0,8.51A6,6,0,0,0,7,28a6.07,6.07,0,0,0,4.28-1.76L9.86,24.82A4,4,0,0,1,4.19,24.82Z"},"children":[]}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"There are two ways to download the chart image using the Grid API as shown below:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"api-documentation","properties":{"source":"grid-api/api.json","section":"charts","names":"[\"downloadChart\", \"getChartImageDataURL\"]"},"children":[]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"You can use the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"downloadChart(params)"}]},{"type":"text","value":" API to download the chart image in the browser."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Alternatively for programmatic use-cases, the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"getChartImageDataURL(params)"}]},{"type":"text","value":" API returns the chart\nimage as string (base64 encoded); this is ideal for  persisting to a back-end, or opening/presenting\nthe chart image statically."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The example below demonstrates how you can retrieve images rendered from the chart in multiple formats."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Click "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Download Chart Image (PNG)"}]},{"type":"text","value":" to download a PNG format image via "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"getChartImageDataURL()"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Click "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Download Chart Image (JPG 800x500)"}]},{"type":"text","value":" to download a custom size image via "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"downloadChart()"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Click "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Open Chart Image (JPG)"}]},{"type":"text","value":" to open a JPEG format image in a new window via "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"getChartImageDataURL()"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"grid-example","properties":{"title":"Downloading Chart Image","name":"downloading-chart-image","type":"generated","options":"{ \"exampleHeight\": 800, \"enterprise\": true, \"modules\": [\"clientside\", \"menu\", \"charts\"], \"myGridReference\": 1 }"},"children":[]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"next-up","style":"position:relative;"},"children":[{"type":"text","value":"Next Up"},{"type":"element","tagName":"a","properties":{"href":"#next-up","ariaLabel":"next up permalink","className":["docs-header-icon","after"]},"children":[{"type":"element","tagName":"svg","properties":{"id":"icon","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 32 32"},"children":[{"type":"element","tagName":"path","properties":{"d":"M29.25,6.76a6,6,0,0,0-8.5,0l1.42,1.42a4,4,0,1,1,5.67,5.67l-8,8a4,4,0,1,1-5.67-5.66l1.41-1.42-1.41-1.42-1.42,1.42a6,6,0,0,0,0,8.5A6,6,0,0,0,17,25a6,6,0,0,0,4.27-1.76l8-8A6,6,0,0,0,29.25,6.76Z"},"children":[]},{"type":"element","tagName":"path","properties":{"d":"M4.19,24.82a4,4,0,0,1,0-5.67l8-8a4,4,0,0,1,5.67,0A3.94,3.94,0,0,1,19,14a4,4,0,0,1-1.17,2.85L15.71,19l1.42,1.42,2.12-2.12a6,6,0,0,0-8.51-8.51l-8,8a6,6,0,0,0,0,8.51A6,6,0,0,0,7,28a6.07,6.07,0,0,0,4.28-1.76L9.86,24.82A4,4,0,0,1,4.19,24.82Z"},"children":[]}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Continue to the next section to learn about: "},{"type":"element","tagName":"a","properties":{"href":"/archive/29.3.1/integrated-charts-api-chart-tool-panel/"},"children":[{"type":"text","value":"Chart Tool Panel API"}]},{"type":"text","value":"."}]}],"data":{"quirksMode":false}},"frontmatter":{"title":"Downloading Chart Image","version":null,"enterprise":true,"sideMenu":null,"description":null},"headings":[{"id":"downloading-charts-via-chart-toolbar","depth":2,"value":"Downloading Charts via Chart Toolbar"},{"id":"downloading-charts-via-grid-api","depth":2,"value":"Downloading Charts via Grid API"},{"id":"next-up","depth":2,"value":"Next Up"}]}},"pageContext":{"frameworks":["javascript","react","angular","vue"],"framework":"javascript","srcPath":"/integrated-charts-api-downloading-image","pageName":"integrated-charts-api-downloading-image"}},
    "staticQueryHashes": ["1766026005","699667431","940729948"]}