cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 VIZ Line graph - Set the Y axis Min and Max Limit

sreehari_vpillai
Active Contributor
0 Kudos

Hi Experts , I have created one VIZ Line chart and I need the Y Axis limit is to be reset .

    

Now the limit is 0 - 600 which is automatically taken by the graph. Can I reset it to 450 to 500 ?

Please help.

Regards

Sree

Accepted Solutions (1)

Accepted Solutions (1)

sreehari_vpillai
Active Contributor

got it

var axis = new sap.viz.ui5.types.Axis().setScale(new sap.viz.ui5.types.Axis_scale().setMinValue(350).setMaxValue(500).setFixedRange(true));

````````````````````````````````

plotArea : {

colorPalette: ["#DF0101","#01DF01"]

},

yAxis : axis ,

dataset : oDataset

});

//With Viz Scale. (After the chart is rendered )

var scales = chart.getVizScales();

scales[1].min = 350 ; // scales[1].feed = 'valueAxis' - choose the array index accordingly

scales[1].max = 500 ;

chart.setVizScales(scales);

Former Member
0 Kudos

Hi Sreehari,

I tried to set the y-axis scale for line chart by using code. But its showing the default value, not displaying the value what i gave. Adding my code for reference. 

   var axis = new sap.viz.ui5.types.Axis().setScale(

       new sap.viz.ui5.types.Axis_scale().setMinValue(20.0).setMaxValue(100.0).setFixedRange(true));

       

     

       

          column = new sap.viz.ui5.Line({  

            width : "100%",

            height : "400px",

            legendGroup: legendPosition,

            plotArea : {

          

            colorPalette : ['#F67A7A','#FEE00A','#B6C359'],

            },

            title : {

              visible : false,

              text : ''

            },

            xAxis:{

            title:{visible:false} ,          

            },

            yAxis : axis ,

           

            dataset : dataset

          });

sreehari_vpillai
Active Contributor
0 Kudos

Suja,

Are you getting any errors in the consol ? if so, please paste it. And, try to pass integer value instead of passing fractions . I think the setMinValue() accepts only integer(not sure, have a look and be back  )

Sreehari

Former Member
0 Kudos

Sreehari,


Thanks for quick replay


I removed decimal and tried but still I am not getting. At the same time I am not getting any error in console.

sreehari_vpillai
Active Contributor
0 Kudos

oh,

pls get a sccreenshot of ur chart and sample data which you are trying .

(batter if you could add  a new post)

Sree

Former Member
0 Kudos

Hello Sreehari,

Even am also getting some error in the console, can you please look at this error and help me to resolve it ??

here is my code

var axis = new sap.viz.ui5.types.Axis().setScale(new sap.viz.ui5.types.Axis_scale().setMinValue(0).setMaxValue(1).setFixedRange(true));

  var dataset1 = new sap.viz.ui5.data.FlattenedDataset({

  dimensions: [{

  axis: 1,

  name: 'DATE',

  value: '{TEXT_DATE}'

  }],

  measures: [{

  name: 'AVAILABILITY',

  value: '{AVAILABILITY}'

  },{

  name: 'QUALITY',

  value: '{QUALITY}'

  },{

  name: 'PERFORMANCE',

  value: '{PERFORMANCE}'

  }

  ],

  data: {

  path: "/d/results"

  }

  });

  oVizFrame1.setVizProperties({

       valueAxis: {

         label: {

           formatString: '0'

         }

       },

       plotArea: {

         dataLabel: {

           visible: true

         }

       },

       title:{

  text : "Daily OEE Details"

  },

       legend: {

         title: {

           visible: true

         },

         yAxis : axis ,

Regards,

Bharath

sreehari_vpillai
Active Contributor
0 Kudos

create a new post man.. its been a long time i created this post !

Sree

Former Member
0 Kudos

thank you

i resolved this issue and can you please look at this below issue ??

Regards,

bharath

Answers (1)

Answers (1)

former_member540067
Active Participant
0 Kudos

Hi Sreehari V Pillai,

How did you solved the issue?

Please suggest.

Regards,

Anmol

sreehari_vpillai
Active Contributor
0 Kudos

Its been 5 years man :slightly_smiling_face:

By the way, I answered this post with correct answer. Please have a look at the answer section.

Sree