You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, I want to apologize if I am doing anything wrong. This is my FIRST ever ticket on Github.
When I select one column for x axis, and start selecting columns for the y axis, the automatic chosen colors seem to appear at total randomness:
I selected them in order, one after the other with no other actions in between. This is constantly happening. I think a predefined set of colors should be used, and colors with easy differentiation. Like excel does, it starts with blue, goes to red, and so on. Always.
Next thing about the colors. Please, remove the yellow from the automatically selected colors:
here it is "easy" to see because there's a lot of fluctuation, but take a look at the beginning of the graph, there's no contrast with yellow on white.
Thanks for your attention. I would gladly collaborate into fixing this, but I lack the knowledge on how to do it.
If you double click on the coloured bar in the Y column, a colour picker should appear allowing you to pick an alternative colour.
Oh, and no, if you save the database as a project, the plot colours aren't saved, so if you do spend an hour picking lovely colours, they'll be lost when you close the database. So don't ever close the database. Ever.
Oh, and welcome to GitHub / DB Browser for SQLite, etc. Your first ticket was a great one! Welcome to the group!
I am aware that I can change the colors (is the first thing I do when the program chooses yellow!).
For the kind of purpose I am using it, I don't save projects. But for your comment it looks like it would help me not to lose my SQL queries, since until now what I do is save a couple of "key" queries, and load and modify them every time. I had no idea that feature existed. Thanks for the info!
I would love to participate in improving the graphing capabilities, since I already have several things in mind that would ease out a lot my workflow. But I don't want to stress the team with tickets.
Interesting. Trying out the plot stuff now (it's not something I've used much personally) looks useful. The filters in the Browse Data table affect it too, which is good for displaying specific things.
At the very least, we should save the plot colours into project files, and restore them when loaded.
Trying to think how best to solve the "default colours" problem though. Maybe we need to add yet another set of Preferences 😉, this time holding the default colours to be used for the y column. Something like:
Row 1 = blue
Row 2 = red
Row 3 = magenta
... (for say, 16 rows)
I think this would achieve the general goal, and if combined with saving colours in project files, would let people override things for specific databases too.
Hmmm, I fear having colors preferences is a bit of an overkill. We could create a constant common sense palette of colors and use those, and save the user's overwrites in the project file.
We can also generate them using HSL instead of RGB, by changing only the hue while maintaining a constant saturation and lightness like this answer.
@struck89 The speed stuff gets done at can be fairly arbitrary. If something looks interesting to muck around with, the chances of it getting done sooner are much higher than stuff that seems super boring. 😉
@struck89 First of all a warm welcome to Github from my side as well 😃 Thanks for opening this issue!
I've just opened a pull request (#819) with which the plot information will be stored internally. This will have two effects:
When configuring a plot, changing the current table, and then coming back to the first table you'll see your plot again with all the colours you have defined.
And (hopefully) all the plot information will be stored in the project files. You will still get yellow plots from time to time but at least your personal colour settings can be stored this way. And as far as I understand, Iulian is working on a better colour selection algorithm, too.
Also, feel free to open as many issues as you like, no matter whether plotting related or not. Maybe not every issue will get as much attention as this one - we're all having our private lifes - but it's good to know what we can do to improve DB4S even further 😃
@MKleusberg Any idea how easy/difficult it would be to have some kind of image export for the plot area? eg "Save to PNG" (or maybe something scalable like SVG?)
Hi @revolter,
well, I don't want to sound rude or ungrateful, but I am sure we can come up with a sequence of colors that is better distinguishable from one another. One question is, in which order did you pick pick columns? The first three are very similar, and going to the center, the difference between alternate colors is still very similar.
Let's face one thing, usually you will just need to plot two, three, four lines, so for me, apart from allowing that functionality, which from your message I understand that you have already done so 👍 , what is left is choosing these easily distinguishable colors. I am going to throw this out there, as a suggestion of a palette that gets the work done:
I would personally increase the saturation of excel's (except for yellow, damn YELLOW!)
Well, it was 3AM when I did that. I was hoping of achieving these colors programmatically, but sadly, I didn't get it right, as you noticed. I'll try to fiddle with it and see if I get it right. The advantage of this method is that the colors are the same every time for a given table (actually, for a number of rows).
@revolter Maybe look for an algorithm which determines "colour distance"? eg how much difference there is between two given colours
Then use your first piece of code from above to generate an initial colour list, + use a "colour distance" algorithm to make sure similar values aren't grouped near each other?
@revolter The last approach (golden ratio one) from the article you linked, really seems to work! right? Is that the code you used? If so maybe you where very unlucky with the randomness?
@struck89 Just merged that PR. So if you're using the project files or plan to do so, with tomorrow's nightly build the plot settings (including the colours!) will be saved in the project file.
Well, I couldn't get it well by generating the colors programmatically :( I wanted for them to be generated based on the number of columns. So, for a table with say 10 columns, they would get the same color every time, not completely random.
I've just pushed a commit which adds a static colour table of 12 colours (taken from the LibreOffice chart colours). Until we come up with a working algorithm this hopefully improves the situation a bit :)
Activity
chrisjlocke commentedon Oct 10, 2016
If you double click on the coloured bar in the Y column, a colour picker should appear allowing you to pick an alternative colour.
Oh, and no, if you save the database as a project, the plot colours aren't saved, so if you do spend an hour picking lovely colours, they'll be lost when you close the database. So don't ever close the database. Ever.
Oh, and welcome to GitHub / DB Browser for SQLite, etc. Your first ticket was a great one! Welcome to the group!
struck89 commentedon Oct 10, 2016
Thanks for the warm welcome Chris :)
I am aware that I can change the colors (is the first thing I do when the program chooses yellow!).
For the kind of purpose I am using it, I don't save projects. But for your comment it looks like it would help me not to lose my SQL queries, since until now what I do is save a couple of "key" queries, and load and modify them every time. I had no idea that feature existed. Thanks for the info!
I would love to participate in improving the graphing capabilities, since I already have several things in mind that would ease out a lot my workflow. But I don't want to stress the team with tickets.
justinclift commentedon Oct 10, 2016
Interesting. Trying out the plot stuff now (it's not something I've used much personally) looks useful. The filters in the Browse Data table affect it too, which is good for displaying specific things.
At the very least, we should save the plot colours into project files, and restore them when loaded.
Trying to think how best to solve the "default colours" problem though. Maybe we need to add yet another set of Preferences 😉, this time holding the default colours to be used for the
ycolumn. Something like:I think this would achieve the general goal, and if combined with saving colours in project files, would let people override things for specific databases too.
Thoughts? 😄
revolter commentedon Oct 10, 2016
Hmmm, I fear having colors preferences is a bit of an overkill. We could create a constant common sense palette of colors and use those, and save the user's overwrites in the project file.
We can also generate them using HSL instead of RGB, by changing only the hue while maintaining a constant saturation and lightness like this answer.
justinclift commentedon Oct 10, 2016
@revolter Sounds workable to me. Want to get it done? 😄
revolter commentedon Oct 10, 2016
I could try, sure 😄
justinclift commentedon Oct 10, 2016
Should this be a #hacktoberfest thing?
struck89 commentedon Oct 10, 2016
I think I found the "line":
https://github.com/sqlitebrowser/sqlitebrowser/blob/master/src/MainWindow.cpp#L1984
Wow, you are all going fast!
justinclift commentedon Oct 10, 2016
@struck89 The speed stuff gets done at can be fairly arbitrary. If something looks interesting to muck around with, the chances of it getting done sooner are much higher than stuff that seems super boring. 😉
MKleusberg commentedon Oct 12, 2016
@struck89 First of all a warm welcome to Github from my side as well 😃 Thanks for opening this issue!
I've just opened a pull request (#819) with which the plot information will be stored internally. This will have two effects:
Also, feel free to open as many issues as you like, no matter whether plotting related or not. Maybe not every issue will get as much attention as this one - we're all having our private lifes - but it's good to know what we can do to improve DB4S even further 😃
justinclift commentedon Oct 12, 2016
@MKleusberg Any idea how easy/difficult it would be to have some kind of image export for the plot area? eg "Save to PNG" (or maybe something scalable like SVG?)
MKleusberg commentedon Oct 12, 2016
There already is 😉

3 remaining items
revolter commentedon Oct 13, 2016
@struck89 and others, what do you say about this:
?
struck89 commentedon Oct 13, 2016
Hi @revolter,
well, I don't want to sound rude or ungrateful, but I am sure we can come up with a sequence of colors that is better distinguishable from one another. One question is, in which order did you pick pick columns? The first three are very similar, and going to the center, the difference between alternate colors is still very similar.
Let's face one thing, usually you will just need to plot two, three, four lines, so for me, apart from allowing that functionality, which from your message I understand that you have already done so 👍 , what is left is choosing these easily distinguishable colors. I am going to throw this out there, as a suggestion of a palette that gets the work done:

I would personally increase the saturation of excel's (except for yellow, damn YELLOW!)
What do you think?
revolter commentedon Oct 13, 2016
Well, it was 3AM when I did that. I was hoping of achieving these colors programmatically, but sadly, I didn't get it right, as you noticed. I'll try to fiddle with it and see if I get it right. The advantage of this method is that the colors are the same every time for a given table (actually, for a number of rows).
justinclift commentedon Oct 13, 2016
@revolter Maybe look for an algorithm which determines "colour distance"? eg how much difference there is between two given colours
Then use your first piece of code from above to generate an initial colour list, + use a "colour distance" algorithm to make sure similar values aren't grouped near each other?
revolter commentedon Oct 13, 2016
I tried using the algorithm from this article too but there are some 2 similar colors pairs.
justinclift commentedon Oct 13, 2016
No worries. If all else fails we can just pick a suitable (say) 20 values and hard code them. 😉
struck89 commentedon Oct 13, 2016
@revolter The last approach (golden ratio one) from the article you linked, really seems to work! right? Is that the code you used? If so maybe you where very unlucky with the randomness?
MKleusberg commentedon Oct 14, 2016
@struck89 Just merged that PR. So if you're using the project files or plan to do so, with tomorrow's nightly build the plot settings (including the colours!) will be saved in the project file.
revolter commentedon Oct 25, 2016
Well, I couldn't get it well by generating the colors programmatically :( I wanted for them to be generated based on the number of columns. So, for a table with say 10 columns, they would get the same color every time, not completely random.
justinclift commentedon Oct 25, 2016
If you set the same seed value every time, wouldn't the randomness disappear?
revolter commentedon Oct 25, 2016
Didn't thought about that :-?
justinclift commentedon Oct 25, 2016
😉
plot: Don't generate colours randomly
MKleusberg commentedon Jan 3, 2017
I've just pushed a commit which adds a static colour table of 12 colours (taken from the LibreOffice chart colours). Until we come up with a working algorithm this hopefully improves the situation a bit :)
justinclift commentedon Jan 3, 2017
As a data point for choosing colours, this site might be useful:
http://colorbrewer2.org
Their GitHub repo:
https://github.com/axismaps/colorbrewer/
The "downloads" link there has a list with 165 palettes. If desired, we could get pretty fancy with things. 😀