wallyflops / d3Graph

Trying to get d3.js working in a QV extension (any graph can be added on later, in theory)
3 stars 3 forks source link

d3.maxfailing? #4

Open adamdavi3s opened 8 years ago

adamdavi3s commented 8 years ago

Hi Guys,

Firstly this has been excellent in helping me learn how to integrate d3 into qlik. However I have an issue in that D3 max, isn't pulling the right value from the array. This also appears to be happening with your solution as the chart isn't sizing correctly for some reason! The only reason mine is showing the full bar is I have hard coded the width at this time. capture

adamdavi3s commented 8 years ago

Aha, I think it is because when you're concatting the dataset into measure1 it is making it a string, which then borks the max.

I made a slight tweak to the code to make this work:

x = d3.scale.linear() .domain([0, d3.max(dataset)])

to:

x = d3.scale.linear() .domain([0, Math.max.apply(Math, dataset)])

wallyflops commented 8 years ago

Can you submit a pull request for this if you've already implemented it?

adamdavi3s commented 8 years ago

I will try.... sorry very new to coding & git malarkey