Forum Discussion
aar0n
8 years agoAdvocate II
d3 Line graph dual y-axis
The following code compiles, but doesn't render a graph. Not sure why exactly it isnt working in power bi.... i am using an input of "Date", "Value1", "Value2". i am trying to plot date on x-axi...
jppp
8 years agoContinued Contributor
I managed to get the code working and basically the trick is in how the data is presented to and used by D3js.
In this case the date column: I have kept it as a string, e.g. '26-Mar-18' and add a derived column, convert as a date type and use that for the 'sort-by' column.
After that the line d3.time.format("%d-%b-%y").parse; will correctly parse the column to dates that can be used by the d3js axis.
If you need some more explanation; I got a PBIX file that I can share if needed.
-JP
aar0n
8 years agoAdvocate II
i would really appreciate if you could share the file!
Thanks for the help!!
- sriksrin8 years agoFrequent Visitor
Thanks jppp for sharing the pbix file. I am still puzzled as the new duplicate column didnot change any data after been applied to sort. Can u share some more details on the fix.