I'm trying to create a graph given the date and a number. When I plot it as a bar graph, it plots the bars right, but how can I make each bar a different color (the SetDataColors doesn't work for this)?
This has come up several times before (search the forum for "color bars"), but the answer is no, there is no way to do this at present. Colors distinguish bars within a group, but corresponding bars in each group have the same color. You can play some tricks by shifting each bar to another group to get different colors, but it doesn't look so good because the bars are offset.
I think a patch was submitted at one time, but I turned it down because it would not be compatible with existing uses of PHPlot. Also I'm not convinced it is a valid feature in terms of graphical representation of data.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
"OWN COLOR FOR EACH BAR" is very neccessary feature for graphical
representation. Before I met PHPlot, i tried to use pChart, libchart, but they
don't have this feature. As I can see, this feature is realized in JpGraph
(ttp://jpgraph.intellit.nl/index.php?topic=4477.0). I hope you will pay
attention to this problem in future. Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
"OWN COLOR FOR EACH BAR" is very neccessary feature for graphical
representation.
More information, please? A reference? I'm looking for more than saying it is
a necessary feature. What is the purpose of the colors that vary for each bar?
Would you use this only for bar charts with one bar per group, or with
multiple bars per group too? How would this work with a plot legend, which
shows the bars in each group by color, if the color varies for different X
values?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello everyone,
I'm trying to create a graph given the date and a number. When I plot it as a bar graph, it plots the bars right, but how can I make each bar a different color (the SetDataColors doesn't work for this)?
So given:
array(array("2008-11-06", 401),
array("2008-11-13",337),
array("2008-11-20",243),
array("2008-11-27",289),
array("2008-12-04",456),
array("2008-12-11",465));
How can each date be a different color?
Thank you for your time.
This has come up several times before (search the forum for "color bars"), but the answer is no, there is no way to do this at present. Colors distinguish bars within a group, but corresponding bars in each group have the same color. You can play some tricks by shifting each bar to another group to get different colors, but it doesn't look so good because the bars are offset.
I think a patch was submitted at one time, but I turned it down because it would not be compatible with existing uses of PHPlot. Also I'm not convinced it is a valid feature in terms of graphical representation of data.
Hi,
"OWN COLOR FOR EACH BAR" is very neccessary feature for graphical
representation. Before I met PHPlot, i tried to use pChart, libchart, but they
don't have this feature. As I can see, this feature is realized in JpGraph
(ttp://jpgraph.intellit.nl/index.php?topic=4477.0). I hope you will pay
attention to this problem in future. Thanks.
More information, please? A reference? I'm looking for more than saying it is
a necessary feature. What is the purpose of the colors that vary for each bar?
Would you use this only for bar charts with one bar per group, or with
multiple bars per group too? How would this work with a plot legend, which
shows the bars in each group by color, if the color varies for different X
values?