Skip to main content



      Home
Home » Eclipse Projects » Remote Application Platform (RAP) » RAP Chart - dataset.label(org.eclipse.rap.chartjs to show the indicator)
RAP Chart - dataset.label [message #1849923] Tue, 08 February 2022 10:21 Go to next message
Eclipse UserFriend
Hello,

I am using org.eclipse.rap.chartjs as our RAP chart provider.

My question is:
When using Bar chart to show data for every months of 3 years, we'll specify 3 colors for the 3 years, each color represents one year(12 bars), then how to show "labels & years" on the top of the chart?
It usually looks like a small square filled with a color(same as its corresponding bars'), and followed with the year number right side, users can tell which color is which year by "labels & years" indicator.

I know It's like setting "chart.data.datasets[x].label" in Chart.js, I also modified function toJson() in ChartRowData.java, added '.add( "label", "2021")', the "label" can be received by Chart.js, but never shows "labels & years" indicator on the top of chart.
I don't know much of JavaScript.
How can I achieve that?

Thank you!

David Lee

[Updated on: Tue, 08 February 2022 10:25] by Moderator

Re: RAP Chart - dataset.label [message #1849944 is a reply to message #1849923] Wed, 09 February 2022 05:49 Go to previous messageGo to next message
Eclipse UserFriend
Hi David,

could you please sketch on your screenshot what do want to achieve (where and what label do you want to place).

Best regards,
Ivan
Re: RAP Chart - dataset.label [message #1849945 is a reply to message #1849923] Wed, 09 February 2022 06:04 Go to previous messageGo to next message
Eclipse UserFriend
Hi David,

just a hint - please check "org/eclipse/rap/chartjs/internal/ChartPaintListener.js" where the chart options from the server are applied to the client widget.

Best regards,
Ivan
Re: RAP Chart - dataset.label [message #1849969 is a reply to message #1849944] Wed, 09 February 2022 21:49 Go to previous messageGo to next message
Eclipse UserFriend
Hi, Ivan,

Thank you for your reply!
What I need is shown like the attached picture, "color and year number" on the top of the chart.

Best Regards,
David

[Updated on: Wed, 09 February 2022 21:52] by Moderator

Re: RAP Chart - dataset.label [message #1849974 is a reply to message #1849945] Thu, 10 February 2022 01:23 Go to previous messageGo to next message
Eclipse UserFriend
Ivan Furnadjiev wrote on Wed, 09 February 2022 06:04
Hi David,

just a hint - please check "org/eclipse/rap/chartjs/internal/ChartPaintListener.js" where the chart options from the server are applied to the client widget.

Best regards,
Ivan


Hi, Ivan,

Thank you for your hint.
I put 'debugger' in the function handleEvent( event ) {} of "org/eclipse/rap/chartjs/internal/ChartPaintListener.js", the "label" was indeed transferred to dataset.label, but it's not shown on the top of chart!
Did I miss something ?

Best,
David
Re: RAP Chart - dataset.label [message #1849977 is a reply to message #1849974] Thu, 10 February 2022 02:27 Go to previous messageGo to next message
Eclipse UserFriend
Hi David,

I'm not familiar with client-side Chart.js API. In the "org/eclipse/rap/chartjs/internal/ChartPaintListener.js" you have to pass the label to the correct option/api of the client-side chart widget (if possible).

Best regards,
Ivan
Re: RAP Chart - dataset.label [message #1850044 is a reply to message #1849977] Sat, 12 February 2022 19:12 Go to previous messageGo to next message
Eclipse UserFriend
Dear Ivan,

Thank you for your replies!

After trying over and over again and looking up related information, my conclusion is:
org.eclipse.rap.chartjs supports Chart.js 1.0 only, which does not support "label"(not "labels") display.

In my opinion, org.eclipse.rap.chartjs is really a simple/good approach to show charts even just supports Chart.js 1.0 only, basically enough for use, the only problem is not showing "label"!
It's a pity!
(If I am wrong, please feel free to let me know!)

Looking forward to seeing its new version if possible!

Best Regards,
David
Re: RAP Chart - dataset.label [message #1851776 is a reply to message #1850044] Fri, 15 April 2022 05:39 Go to previous messageGo to next message
Eclipse UserFriend
Excuse me Did You discuss about RAP chart from incubator ( https://www.eclipse.org/rap/incubator/ )?
Re: RAP Chart - dataset.label [message #1851785 is a reply to message #1851776] Fri, 15 April 2022 09:34 Go to previous message
Eclipse UserFriend
Dmitry Dukhov wrote on Fri, 15 April 2022 05:39
Excuse me Did You discuss about RAP chart from incubator ( https://www.eclipse.org/rap/incubator/ )?


Hi, Dmitry,

No.
We discussed about org.eclipse.rap.chartjs which you can download from https://github.com/tbuschto/rap-chartjs not the incubator one on https://git.eclipse.org/c/rap/incubator/org.eclipse.rap.incubator.chart.git
I referred to https://eclipsesource.com/blogs/2014/07/21/yet-another-charting-widget-for-rap/ at first.

David

[Updated on: Fri, 15 April 2022 09:42] by Moderator

Previous Topic:Best practise to dynamically set session language in RAP
Next Topic:Rap e4 UISynchronize
Goto Forum:
  


Current Time: Fri May 09 04:46:09 EDT 2025

Powered by FUDForum. Page generated in 0.04941 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top