How change te answer colors?

More
5 years 4 months ago #69051 by rodigo1991
Hello, I wonder if I can change the colors of the answers in LimeSurvey, because I wanted all the answers have the same sequence of colors, for example:

In an array of five, the first answer would be the color red and the second answer would be blue and so on, but when there are different levels of answers, the colors are in different orders...

will I get change? How?




Attachments:

Please Log in to join the conversation.

More
5 years 4 months ago #69065 by Mazi
I don't know where it is located but there is a .pal file shipped with Limesurvey which holds the colors.
Have a look at the documentation of the pchart library which we use for charts. It is explained there how to edit the file and define your own colors.


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

More
5 years 1 month ago - 5 years 1 month ago #74867 by M1lkSh4k3
I'm trying editing this file: /var/www/limesurvey/classes/pchart/pchart/ pChart.class

How can i set always:

1-red
2-yellow
3-green
4-blue
5-blue (blue black)

If you not answer the question number 1, then question 2 will be red...I need fixed colors on numbers, but i'm trying a lot and can't do it...

For example: 1 always red, 2 always yellow... if i not answer the number 1, the question 2 must be always yellow not red...

I have no idea how can i do this in php, i'm not a developer...

I really appreciate any kind of help

Thanks, limesurvey is a fantastic tool, i just love it !
Last Edit: 5 years 1 month ago by M1lkSh4k3.

Please Log in to join the conversation.

More
5 years 1 month ago - 5 years 1 month ago #74884 by DenisChenu
Hello,

LS remove the answer at 0, need some modification on the code.

Search "this block is to remove the items with value"

And after replace
[code type=php-brief]if ($gdata[$i] == 0 || ($qtype == "O" && substr($lbl[$i],0,strlen($statlang->gT("Comments")))==$statlang->gT("Comments")))[/code]
by
[code type=php-brief]if (false && ($gdata[$i] == 0 || ($qtype == "O" && substr($lbl[$i],0,strlen($statlang->gT("Comments")))==$statlang->gT("Comments"))))[/code]

For color palette the file is admin/styles/default/limesurvey.pal

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
Last Edit: 5 years 1 month ago by DenisChenu.
The following user(s) said Thank You: M1lkSh4k3

Please Log in to join the conversation.

More
5 years 1 month ago #74910 by Mazi
To my knowledge there is no easy way to hard code an assignment of colors to answer options. The colors are assigned to answer options subsequesntly and if an answer has received 0 clicks, it will be left out and the next option will be assigned the according color.

One solution might be to define different color schemes and embedd them dynamically depending on the number of answer items with zero answers. But this will require quite some coding.


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

More
5 years 1 month ago - 5 years 1 month ago #74995 by M1lkSh4k3
Hi Shnoulle,

Thanks for the post, i really appreciate your help !

Which file do i search this information ?

Search "this block is to remove the items with value"

And after replace
if ($gdata[$i] == 0 || ($qtype == "O" && substr($lbl[$i],0,strlen($statlang->gT("Comments")))==$statlang->gT("Comments")))

by
if (false && ($gdata[$i] == 0 || ($qtype == "O" && substr($lbl[$i],0,strlen($statlang->gT("Com

I didn't find it in /var/www/limesurvey/classes/pchart/pchart/pChart.class

Thanks again!
Last Edit: 5 years 1 month ago by M1lkSh4k3.

Please Log in to join the conversation.

More
5 years 3 weeks ago #75276 by Mazi
Maybe at /statistic_functions.php


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

More
5 years 3 weeks ago #75310 by rodigo1991
Heya Denis, I edited with your instruction the LimeSurvey/admin/statistics_function.php

But after that some zeros percents (0%) are on graphics now:


Attachment figura2.png not found



I don't know why theses “0%” are there now 'cause they weren't before theses changes on statics_function.php

Do you know how to fix it?
Attachments:

Please Log in to join the conversation.

More
5 years 3 weeks ago #75415 by rodigo1991

Shnoulle wrote: Hello,

LS remove the answer at 0, need some modification on the code.

Search "this block is to remove the items with value"

And after replace
[code type=php-brief]if ($gdata[$i] == 0 || ($qtype == "O" && substr($lbl[$i],0,strlen($statlang->gT("Comments")))==$statlang->gT("Comments")))[/code]
by
[code type=php-brief]if (false && ($gdata[$i] == 0 || ($qtype == "O" && substr($lbl[$i],0,strlen($statlang->gT("Comments")))==$statlang->gT("Comments"))))[/code]

For color palette the file is admin/styles/default/limesurvey.pal

Denis


Heya Denis, I edited with your instruction the LimeSurvey/admin/statistics_function.php

But after that some zeros percents (0%) are on graphics now:


Attachment figura2.png not found



I don't know why theses “0%” are there now 'cause they weren't before theses changes on statics_function.php

Do you know how to fix it?
Attachments:

Please Log in to join the conversation.

More
5 years 3 weeks ago #75444 by DenisChenu

rodigo1991 wrote: Do you know how to fix it?

Not with more adaptation and more time to see condition .

If you don't remove the (0) then color are different but it shown on the statistics.

More work to have same color and not shown, a lot of work and time.

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).

Please Log in to join the conversation.

More
5 years 1 week ago - 5 years 1 week ago #76447 by iabbok
Hello,
to support this issue, please go all to new ideas features and vote the idea: I made this last year at ideas.limesurvey.org/ideatorrent/idea/61/

I hope some developer will realize this idea because who use statistics in limesurvey need it!
Last Edit: 5 years 1 week ago by iabbok.

Please Log in to join the conversation.