syntagmatic/parallel-coordinates

parcoords.dimensions does not allow to plot my data

Borreguin opened this issue · 3 comments

Hello,
I'm using a shared scale and I want to change the name of each dimension. I use the following code to do that, but when I introduce dimension in the chart, then is not working anymore:

//getting 7 dimensions, 1 per each day
var days = json_list['days'];
for(idx in days){ dimensions[days[idx]] = {type:"number"}; };
var pc = d3.parcoords()("#example")
.data(json_list['V050_room202_temp'])
.commonScale()
.render()
.dimensions(dimensions)
.createAxes()
.render()
.brushMode("1D-axes") // enable brushing
.interactive(); // command line mode;

If I dont include dimension then the charts. Thanks for your help. =)

Not sure, but try adding .autoscale() after the .dimensions() call. It may be the domain just needs to be set on each dimension, and that should do it.

I tried, unfortunately is not working... There is a way to change the names of each dimensions? because I fit my data as an array, so the names of each axe is 0,1,2...6.
Addionally... I would like to color each register based on an array of colors. I mean: my data = [[1,2,3,4],[-1,2,3,4],[5,2,3,3], etc] and my colors for each register: colors = [c1, c2, c3, etc.]. There is a way to this mapping?
Thanks for your help.

Numbers are acceptable dimension names. You may shape your data however you like, just provide the data as an array of homogenous objects.

The polylines can be colored using this method: https://github.com/syntagmatic/parallel-coordinates#parcoords_color

You can also style axes with CSS or use D3 to make modifications after they've been created.