Forum Stats

  • 3,837,795 Users
  • 2,262,300 Discussions
  • 7,900,394 Comments

Discussions

How to customize ojet Chart y-Axis / decimal Places

User_RPM7N
User_RPM7N Member Posts: 7 Green Ribbon
edited Mar 10, 2021 12:45PM in APEX Discussions

We have a single chart region for all our analyses. We generate the SQL with PL/SQL.

We have stored the configuration of our charts in a table.

We have Charts like this:

-----------------------------------------------------------

Select 'population development' as chart, 'bar' as chart_type, 'State' as x_axis, 'Number' as y_axis, 0 as decimal_places, null minVal, null maxVal from dual

Union all

Select 'Temperature' as chart, 'line' as chart_type, 'healthy/sick' as x_axis, 'Celsius' as y_axis, 1 as decimal_places, 33 minVal, 45 maxVal from dual

Union all

Select 'teacher' as chart, 'pie' as chart_type, null as x_axis, null as y_axis, 2 as decimal_places, 0 minVal, 1 maxVal from dual

======================================================


The PL/Sql gives us for the following SQLs

-----------------------------------------------------------

chart1 (population development):

select 'USA' as categorie , +1000 as value from dual

union all

select 'Germany' as categorie , -2000 as value from dual


Chart2 (Temperature)

select 'healthy' as categorie , 36,5 as value from dual

union all

select 'sick' as categorie , 38,5 as value from dual


Chart3 (Teacher)

select 'man' as categorie , 57% as value from dual

union all

select 'woman' as categorie , 43% as value from dual

======================================================

After refresh we set title and chart type with the following call:

-----------------------------------------------------------

$("#our_chart_jet").ojChart({type: $("#P1_CHART_TYP").val()});

$("#our_chart_jet").ojChart({xAxis:{title:$("#P1_X_AXIS").val()}});  

if ( $("#P1_MIN").val() !=‘‘&& $("#P1_MAX").val() !=‘‘) {

  $("#our_chart_jet").ojChart({yAxis:{title:$("#P1_Y_AXIS").val(), min: $("#P1_MIN").val(), max: $("#P1_MAX").val() }});

  }

else{

  $("#our_chart_jet").ojChart({yAxis:{title:$("#P1_Y_AXIS").val()}});      

  }

======================================================

Now our question:

-----------------------------------------------------------

How can we extend our call accordingly ?

*chart1(population development) should not show decimal places on the y-axis.

*chart2(temperature) should show decimal places on the Y-axis.

*chart3(teacher) should show decimal places on the Y-axis.

OR:

Can we perhaps already have these parameters under:

Advanced: JavaScript Initialization Code?

===================================================

MANY THANKS😊

and greetings from Munich

Best Answer

Answers