Home › forums › Chart Support › Scaling Canvas for PDF printing
Tagged: pdf, Printing
We’ve run into an issue when using CanvasJS for printing. Basically, when we have a canvas chart, which we want to export, so, for example this one: http://jsfiddle.net/ownd0vcr/
We can’t export it at that current size, because it would come out blurry and small. So we upscale it, printing DPI is around 3 times the DPI of a screen, so we basically tried to solve this by blowing up the chart, making it huge, creating the chart with large text sizes, then shrinking it down and putting it on a PDF. So when the user prints the page, they get a chart which is not blurry, it looks good. We have one problem though, as you can see here in my blown up example: http://jsfiddle.net/0L59tytv/
As it assumes it has the space I guess? It looks like it adds hundreds of items along the axisX, it adds a huge amount, we don’t need this many. We just want to show about 8 or so, we have tried adding code for an interval count amount, but we don’t want to write code for your software which we don’t entirely understand, because this requires us to maintain it, to make sure it works, it’s a risk we can’t take. We can’t continue to use your software happily unless their is a way, to define how many ticks per axis are to be shown. We want to be able to say:
or something like that.
Sorry we don’t have this feature as of now. We had considered it, but found intervals were not proper. For example, if minimum is 0, maximum is 80 and user likes to have 7 ticks in that range, interval comes out to be 11.42857142857143 (~11.43), which is not convenient to the user. But we’ll reconsider this feature in future releases.
As of now, you can manually calculate interval to achieve the same. For Example, if the minimum is 0, maximum is 90 and if you like to show 8 number of ticks, you can set interval to 11.25.
I am also looking forward to use this one, but hopefully by time that I have decided to go through, things should be up and going well, no issue when use and an available fixes included in the update once there is issue arising.
You must be logged in to reply to this topic.