Rank: Administration
Groups: Administrators
Joined: 12/20/2013(UTC) Posts: 1,209 Thanks: 14 times Was thanked: 206 time(s) in 199 post(s)
|
For a specific chart, you can force the colors chosen for the NVD3 Chart by editing the NVD3 Chart Configuration script of your model: just replace Code:
.color(d3.scale.category10().range())
by the colors needed Code:
.color(['blue','green','red','yellow'])
to force the colors... and thats it !
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 11/3/2015(UTC) Posts: 1 Location: Gent
|
Hello, This works but..... The colors change according to the result set. I read that you should be able to link a color to a certain domain For example using a splitter field Category HIGH ---> RED Category MEDIUM --> ORANGE Category LOW ---> GREEN Th color should contain a range defining the Hex values of the color And there should also be a domain, corresponding to each field having a specific color defined in range. I see some examples on the net, but cant seem to make it work. http://stackoverflow.com...scale-in-a-d3-line-charthttps://github.com/mbostock/d3/wiki/Ordinal-ScalesAny ideas, i am,completely stuck and already spent hours looking for a solutiion Thanks Edited by user Tuesday, November 3, 2015 7:30:55 AM(UTC)
| Reason: Typos
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/20/2013(UTC) Posts: 1,209 Thanks: 14 times Was thanked: 206 time(s) in 199 post(s)
|
I found another way you can try, just add the following function you can customize (tested on Northwind on the product category): Code:
chart.color(function(d) {
if (xLabels[d.x] == 'Condiments') return 'yellow';
return 'green';
});
it actually uses the x value of the point and the xLabels array defined for the chart. Good luck.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.