Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: How change te answer colors?

How change te answer colors? 2 years 10 months ago #69051

  • rodigo1991
  • rodigo1991's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
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?

cor1.png



cor2.png
The administrator has disabled public write access.

Re: How change te answer colors? 2 years 10 months ago #69065

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5325
  • Thank you received: 296
  • Karma: 249
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)limesurvey.org'"
The administrator has disabled public write access.

Re: How change te answer colors? 2 years 7 months ago #74867

  • M1lkSh4k3
  • M1lkSh4k3's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 6
  • Karma: 0
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: 2 years 7 months ago by M1lkSh4k3.
The administrator has disabled public write access.

Re: How change te answer colors? 2 years 7 months ago #74884

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6362
  • Thank you received: 827
  • Karma: 245
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
Last Edit: 2 years 7 months ago by DenisChenu.
The administrator has disabled public write access.
The following user(s) said Thank You: M1lkSh4k3

Re: How change te answer colors? 2 years 7 months ago #74910

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5325
  • Thank you received: 296
  • Karma: 249
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)limesurvey.org'"
The administrator has disabled public write access.

Re: How change te answer colors? 2 years 7 months ago #74995

  • M1lkSh4k3
  • M1lkSh4k3's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 6
  • Karma: 0
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: 2 years 7 months ago by M1lkSh4k3.
The administrator has disabled public write access.

Re: How change te answer colors? 2 years 7 months ago #75276

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5325
  • Thank you received: 296
  • Karma: 249
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)limesurvey.org'"
The administrator has disabled public write access.

Re: How change te answer colors? 2 years 7 months ago #75310

  • rodigo1991
  • rodigo1991's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
Heya Denis, I edited with your instruction the LimeSurvey/admin/statistics_function.php

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


figura2.png


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?
The administrator has disabled public write access.

Re: How change the answer colors? 2 years 7 months ago #75415

  • rodigo1991
  • rodigo1991's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
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:


figura2.png


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?
The administrator has disabled public write access.

Re: How change the answer colors? 2 years 7 months ago #75444

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6362
  • Thank you received: 827
  • Karma: 245
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
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.155 seconds
Donation Image