gpt4 book ai didi

php - JpGraph 图例顺序

转载 作者:搜寻专家 更新时间:2023-10-31 21:16:25 26 4
gpt4 key购买 nike

我正在使用带有 JpGraph 的累积条形图,并希望更改项目在图例中出现的顺序(我想按字母数字顺序对它们进行排序)。我检查了文档,但没有找到任何相关内容:我有什么选择可以实现这个目标吗? (JpGraph 似乎自行对图例进行排序)

最佳答案

可悲的是,我不相信有直接的,但是:

By default the ordering of the texts in te legend will be the same as the order the plots are added to the graph. It is also possible to reverse this order in the legend with a call to the method Legend::Reverse()

$graph->legend->SetReverse();

您可以根据需要以编程方式对您的系列进行排序,然后按您想要的顺序将它们推送到图表以实现您想要的...

关于php - JpGraph 图例顺序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7686727/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com