Jump to content

Topic on Extension talk:Chartie/Flow

CSS for plot and dot

7
Simpsonspedia.net (talkcontribs)

.plot { stroke: #fc1; } .dot { fill: #eb0; }

https://simpsonspedia.net/index.php/Datei:Quoten_Staffel_33.csv

In this way both plots are of the same color. If I see it correctly, extensive adjustments would need to be made to the Chartie.js file.

In that case I would like the two plots to have different colors and the dots too. In the next step I would like to give all dots a different color at a fixed x value.

Martynov Maxim (talkcontribs)

By default, color is calculated using plot name hash, so for different plot names there should be different colors. As I see, one plot is yellow, and another is green. What adjustments are you talking about?

Simpsonspedia.net (talkcontribs)

screenshot: https://simpsonspedia.net/Chartie_01.png

Both plots are yellow. My CSS adjustment .plot { stroke: #fc1; } make all plots yellow.

By default first plot is rgb(149, 179, 0) and second plot is rgb(60, 179, 0). Both use the class "plot". I see no option to set a individual color for each plot.


If I changing CSS in my browser I can create my desired temporary result.

modified screenshot: https://simpsonspedia.net/Chartie_02.png

2 different individual colors and i. e. for the third episode all dots are black.

How and where do I need to make adjustments to achieve this end result?

Simpsonspedia.net (talkcontribs)

var color = intence("hsl(" + d.key.toString().hashCode() + ",100%,35%)", false);

var color = intence("hsl(" + name.toString().hashCode() + ",100%,35%)", false);

I added my simple color change to both. Not elegant, but it works.

// name = US

if (color == "rgb(149, 179, 0)")

{

color = "#fc1";

}

// name = D

if (color == "rgb(60, 179, 0)")

{

  color = "#c11";

}


Now all that’s missing is a solution for the black dot for a specific episode.

Martynov Maxim (talkcontribs)
Simpsonspedia.net (talkcontribs)

2 default colors != 2 individual colors

Martynov Maxim (talkcontribs)

If you want option to setup specific color for a curve, open a pull request in Github

Reply to "CSS for plot and dot"