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

Problem with precision in the x or y value #50

Closed
mbrasil opened this issue Oct 25, 2013 · 2 comments
Closed

Problem with precision in the x or y value #50

mbrasil opened this issue Oct 25, 2013 · 2 comments

Comments

@mbrasil
Copy link

mbrasil commented Oct 25, 2013

I'm working with this plugin and, first of all, I have to tell you that It's great!

The code was working fine for the pie precision. But when I tried in the x or y in a bar chart I came across this issue. The precision was not working. I looked at the source code for the plugin and I find out what was the issue.

I just put the following lines in the code, overwriting the existing ones, and it worked. So I'm here to share this with you. The lines are:

164 var xPattern = /%x.{0,1}(\d{0,})/;
165 var yPattern = /%y.{0,1}(\d{0,})/;

instead of

164 var xPattern = /%x.{0,1}(?:\d{0,})/;
165 var yPattern = /%y.{0,1}(?:\d{0,})/;

@tomvonclef
Copy link

I ran into the same problem, and this code fixed it. Thanks!

Here are my flot options, in case it is of use in debugging this:

flotOptions = {
    series: {
        lines: { show: true },
        points: { show: true },
        grow: {
            active: AnimationBrowser,
            steps: StepCount,
            stepDelay: StepDelay
        }
    },
    xaxis: {
        ticks: 24,
        min: 1,
        max: 24,
        tickDecimals: 0
    },
    grid: {
        hoverable: true //this is needed for tooltip to work  
    },
    tooltip: true,
    tooltipOpts: {
        content: "'%s': Hour %x.1 is %y.4",
        shifts: {
            x: -60,
            y: 25
        }
    }
};

@krzysu
Copy link
Owner

krzysu commented Oct 30, 2013

thanks for pointing this issue, but it is more complicated. Check that #16 and let me know if you have any ideas how to solve both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants