条形图上的不同颜色取决于值?
我想使用 JQPlot jquery 图表插件根据条形图的值将条形图设置不同的颜色。
E.g. the rendered bars will be colored with RED if the value of the bar is 13 and over
the rendered bars will be colored with YELLOW if the value of the bar is between 10 - 12
the rendered bars will be colored with BLUE if the value of the bar is less than 10
这可能吗?示例片段是什么?我似乎在网上找不到太多信息。
谢谢
I am wanting to set the bars a different colour depending on their values using the JQPlot jquery chart plugin.
E.g. the rendered bars will be colored with RED if the value of the bar is 13 and over
the rendered bars will be colored with YELLOW if the value of the bar is between 10 - 12
the rendered bars will be colored with BLUE if the value of the bar is less than 10
Is this possible and what would an example snippet be? I can't seem to find much information online.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看此处给出的答案。
我不确定它是否有效,但它可能会为您指明正确的方向。基本上,它是关于重写 jqPlot 颜色生成器并根据条形图的值返回颜色。
Take a look at the answer given here.
I'm not sure if it works but it might point you in the right direction. Basically, it's about overriding the jqPlot color generator and return a color based on the value of the bar.