Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 15:21 Go to next message
David Lee is currently offline David LeeFriend
Messages: 81
Registered: May 2013
Member
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 15:25]

Report message to a moderator

Re: RAP Chart - dataset.label [message #1849944 is a reply to message #1849923] Wed, 09 February 2022 10:49 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2427
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
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 11:04 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2427
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
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] Thu, 10 February 2022 02:49 Go to previous messageGo to next message
David Lee is currently offline David LeeFriend
Messages: 81
Registered: May 2013
Member
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: Thu, 10 February 2022 02:52]

Report message to a moderator

Re: RAP Chart - dataset.label [message #1849974 is a reply to message #1849945] Thu, 10 February 2022 06:23 Go to previous messageGo to next message
David Lee is currently offline David LeeFriend
Messages: 81
Registered: May 2013
Member
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 07:27 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2427
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
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] Sun, 13 February 2022 00:12 Go to previous messageGo to next message
David Lee is currently offline David LeeFriend
Messages: 81
Registered: May 2013
Member
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 09:39 Go to previous messageGo to next message
Dmitry Dukhov is currently offline Dmitry DukhovFriend
Messages: 194
Registered: February 2013
Senior Member
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 13:34 Go to previous message
David Lee is currently offline David LeeFriend
Messages: 81
Registered: May 2013
Member
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 13:42]

Report message to a moderator

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


Current Time: Sat Nov 09 01:29:06 GMT 2024

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

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

Back to the top