Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

LS 2.5: No random chart colors?

More
7 years 4 months ago #143498 by TEMA
LS 2.5: No random chart colors? was created by TEMA
Hi,
I need to change the colors of the statistic-charts.
I found the limesurvey.pal file with all the rgb values of the colors used for the charts (there are 72).
In the source-code I can see that the div, which is holding the chart, has a data-attribute with a color-number (e.g. data-color="32"). It seems for me, that this number is randomized (I can't discover any rule, each chart has d different one).

Is it possible to change this behaviour so that each chart starts with color 0?

Thanx
The topic has been locked.
  • LouisGac
  • LouisGac's Avatar
  • Visitor
  • Visitor
7 years 4 months ago #143570 by LouisGac
Replied by LouisGac on topic LS 2.5: No random chart colors?
It implies to change the core code, so it's not really recommended, unless you know what you're doing.
In the future, the color behavior should be customizable from the admin interface.

For information, for advanced statistics in admin, the color randomization process is here:
github.com/LimeSurvey/LimeSurvey/blob/ma...ics_helper.php#L3789

And then it's used here:
github.com/LimeSurvey/LimeSurvey/blob/ma...icsoutput_graphs.php

So, in this last file, you can define the index of your first color (eg: 0) adding after the line 16 :
Code:
$color = 0;
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose