Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Funnel Chart Misaligned in Canvas Area in 1.0.9 #122

Merged
merged 1 commit into from May 16, 2017

Conversation

gkjothi20
Copy link
Contributor

… big in canvas and broken.

Issue Detail:- With Version 1.0.9, funnelchart plot is very big in size and going out of canvas area.This happens only if devicepixelratio is >1 in any browser and in firefox whose pixelratio is -1.

Analysis:- Observed that in jquery.jqplot.js InitCanvas method,Canvas is set based on device pixelratio.But in plugin file funnelrenderer.js CSS Canvas width and height is not considered for plotting funnel chart within canvas.This is causing issue.
This was handled only in pierenderer in version 1.0.9.

Solution:- Applied CSS Canvas width and height in draw function of funnelrenderer. Chart comes-up fine irrespective of device pixel ratio in all browsers.

… big in canvas and broken.

Issue Detail:- With Version 1.0.9, funnelchart plot is very big in size and going out of canvas area.This happens only if devicepixelratio is >1 in any browser and in firefox whose pixelratio is -1.

Analysis:- Observed that in jquery.jqplot.js InitCanvas method,Canvas is set based on device pixelratio.But in plugin file funnelrenderer.js CSS Canvas width and height is not considered for plotting funnel chart within canvas.This is causing issue.
This was handled only in pierenderer in version 1.0.9.

Solution:- Applied CSS Canvas width and height in draw function of funnelrenderer. Chart comes-up fine irrespective of device pixel ratio in all browsers.
@gkjothi20
Copy link
Contributor Author

Issue Details:- #121

@johanbove johanbove added the bug label May 16, 2017
@johanbove johanbove self-assigned this May 16, 2017
@johanbove johanbove merged commit 1870d3b into jqPlot:master May 16, 2017
@johanbove
Copy link
Member

Thank you for contributing @gkjothi20 !

@bulldozier
Copy link

One more fix is needed to make it size correctly in all charts. In the _jqpToImage function, it needs to use the inner size when calling drawImage:

            else if (tagname == 'canvas') {
                var hh = $(el).innerHeight() - 2 * parseInt($(el).css('padding-top'), 10);
                var ww = $(el).innerWidth() - 2 * parseInt($(el).css('padding-left'), 10);

                newContext.drawImage(el, left, top, ww, hh);
            }

@johanbove johanbove added this to the jQplot 1.0.10 milestone Sep 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants