Open dhmontgomery opened 2 weeks ago
I believe I have found the cause of the problem! In the API docs, it lists two different relevant parameters:
zoom
: "Defines the chart scale. E.g, a zoom of 3 makes the chart 3 times wider and taller in px size resulting in a higher resolution chart. Default is 2."scale
: "Defines the chart scale for PDF exports, similar to the zoom parameter for PNGs."I extracted dw_call_api()
from the function and did some experimenting, and if you change the scale = scale[1]
parameter to zoom = scale[1]
you get PNG output of different sizes, as expected.
Possible solutions:
scale
sets both the scale
and zoom
parameters: ... scale = scale[1], zoom = scale[1], ...
(As near as I can tell this works without causing an error)type
parameter to determine whether the value of scale
should be sent to the scale
or zoom
API parameters. scale
and zoom
and require the user to pick the correct one (this seems like a bad idea)I will work on a pull request, unless someone has strong thoughts on the various options before I finish that.
When I attempt to export a chart via dw_export_chart(), the scale parameter does not appear to do anything. The intended output, as far as I can tell, is that giving this a value between 1 and 4 should increase the size of the image by multiplicative factors.
But when I put in different values, I get the exact same output. For example, all these return identical images:
Put another way:
This replicates on different images. I can still use the GUI to export these images at different scales, it just doesn't do anything with
dw_export_chart()
.