tiby312 / poloto-project

MIT License
159 stars 10 forks source link

Option to add empty name / remove bar of colour above #141

Closed Icelk closed 2 years ago

Icelk commented 2 years ago

To display additional information next to the name of the data, I've added an empty scatter. That however still results in a coloured bar above the text.

Is there potential for an option of removing the bar and or a separate method for showing info there?

Great project!

tiby312 commented 2 years ago

@Icelk you miiight be able to do this already by specifying the color of that plot to be transparent or the same as the background via css. Try modifying these css classes

poloto[n]fill - If the n'th plot requires fill. (e.g. linefill or histogram) poloto[n]stroke - If the n'th plot requires stroke. (e.g. line or scatter)

See this example for custom css

Icelk commented 2 years ago

Sounds good. I’m however worried that if I have several datapoints for which I want the colour to wrap around, this ain’t possible.

Would it be possible to just not output that bit of SVG, at least if the data iterator is empty?

tiby312 commented 2 years ago

@Icelk Ah ok i think i understand. I pushed a version that adds a new text() function.

source

rendered

Icelk commented 2 years ago

Looks like exactly what I needed. Thanks!