Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Jet charts: fix Bar chart label height or bar height

JabbampApr 12 2018 — edited Apr 19 2018

Hi there all. Although I am getting better at this, there are still so many mysteries I have search answers for and cannot find them anywhere.

I am using Apex 5.1.4. Below is a bar chart region. For lack of something that could do the job better, I am using this as a kind of indicator. It used to be a column which is not used anymore so instead I am using barchart.

pastedImage_2.png

The values will never basically be more than 1. So I would either like to reduce the bar height to about a quarter of what it is now, or I would like to make the x axis lables keep thier size so that if I reduce the region size, the bars reduce but the lable stays the same so I can see all the text. If I try and reduce the region size it will not show the whole of the x axis labels like below.

pastedImage_7.png

So basically I would like to achieve this like the edited image below.

pastedImage_1.png

I've tried to solve this for the last 2 weeks on and off to no avail

This post has been answered by Oleh Tyshchenko on Apr 12 2018
Jump to Answer

Comments

Oleh Tyshchenko
Answer

This might be helpful - Missing full X Axis labels

Marked as Answer by Jabbamp · Sep 27 2020
Pierre Yotti

Have you check that property?

Screenshot_20180412-203125.png

fac586

Jabbamp wrote:

Hi there all. Although I am getting better at this, there are still so many mysteries I have search answers for and cannot find them anywhere.

I am using Apex 5.1.4. Below is a bar chart region. For lack of something that could do the job better, I am using this as a kind of indicator.

Instead of asking XY questions about a solution that you are not happy with, it would be a better use of both your time and ours if you described the problem that you are actually trying to solve. What "kind of indicator" would you really like to see? Give us some background about the environment, problem domain, and application, and describe the requirements (and any restrictions) in detail.

It used to be a column which is not used anymore so instead I am using barchart.

I have no idea what that means. If it is relevant to the problem, please try to explain this more clearly.

Jabbamp

Thank you, absolutely perfect. Also to add that because of you pointing me to this answer I managed to find where I could see all the classes here https://docs.oracle.com/middleware/jet202/jet/reference-jet/oj.ojChart.html#xAxis.titleStyle . As a complete noob his has been a big valuable piece of help. Thanks again

Jabbamp

Hi, yes I did, but it didn't do what I needed. But thank you for replying.

Jabbamp

Hi fac586. I understand what you are saying, but I really just needed exactly what I asked for. The problem I was trying to solve was just to reduce the bar height. The rest has been made by a developer earlier and I don't have any say in the query. The solution he had was made on 4.2 and I have just been working with the migration to 5.1.4. It just needed to look close to what it was before using the new Jet Charts, not really my choice. So that was the exact problem I was trying to solve - just very basically to reduce the bar height and keep the full labels showing.

Ignore the statement about the column. I just saw that the method used in the old 4.2 application was with a stacked 2d column. I was trying to explain that and basically failed in this respect. So I just wanted to basically get the same look.

If I go further and start actually developing new reports at some point and need help, I would certainly detail the scenario much more fully. I appreciate the tips though and will for sure take that into consideration in the future.

Pierre Yotti

Hi, Rather that use custom javascript, I will use a build-in functionality. The minimum, maximum, format type and decimal places in the bar chart property do what you need. Just use it good

Jabbamp

Hiya Alli,

I did try to use these, but the hight of the bar would not go any lower. I set the lowest values. The only way to decrease the bar height was to reduce the region, but then the labels on x axis would cut cut off as shown in the images in the original post. Using the javascript worked perfectly though.

pastedImage_0.png

Pierre Yotti

Can you reproduce it on online apex?

Jabbamp

Hi There Alli,

Unfortunately I have moved on from the company I was doing the work for and am starting something else with another company so will be working with PHP and MySql going forward. I do not have access to the work now and also unfortunately will not be working with Apex for the meanwhile at least.

But basically, in the attributes of the bar chart, I just put this code into the Advanced attributes in the JavaScript code:

function( options ) //takes options

{   

  options.xAxis.size  = "80%" //size in %

  options.styleDefaults.barGapRatio = 0; //gap between bars

  return options;  //return set options

All the classes for the charts can be found here: -

https://docs.oracle.com/middleware/jet202/jet/reference-jet/oj.ojChart.html#xAxis.titleStyle

Don't know if that's helpful to you. I hope at some point I'll return to using Apex as I thinks its a very good product.

1 - 10
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on May 17 2018
Added on Apr 12 2018
10 comments
213 views