How do I set the Y axis value interval?


« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Ananth on 24th October 2017
Hi Richard,

how can we specify y-axis interval with specified value like in this one if you see the y axis value starts from 6200 and then 7360 instead i need to use 7200, 8200, 9200 etc

var objData = [null, 9004, 8638, 10304, null]
var objyMin = 6200
var objyMax = 12000

var line = new RGraph.Line({
                  id: 'cvs',
                  data: objData,
                  options: {
                      //gutterBottom: 45,
                      gutterLeft: 60,
                      labels: ['', 'Apr', 'May', 'Jun', ''],
                      colors: ['#7CB5EC'],
                      tickmarks: 'filledsquare',
                      shadow: false,
                      labelsAbove: true,
                      labelsAboveBorder: false,
                      linewidth: 1,
                      ymin: objyMin,
                      ymax: objyMax,
                      title: 'X',
                      titleYaxis: 'Y',
                      titleYaxisSize: 7,
                      titleYaxisBold: true,
                      titleYaxisPos: 0.2,
                      titleXaxisColor: 'black',
                      backgroundColor: '#e5f3ff',
                      backgroundGrid: true,
                      backgroundGridColor: '#fff',
                      backgroundGridVlines: false,
                      backgroundGridBorder: false,
                      hmargin: 5,
                      scaleZerostart: true,
                      axisColor: '#000000',
                      numxticks: 0,
                      noyaxis: false,
                      textFont: 'Segoe UI',
                      textSize: 10,
                      textColor: '#000000',
                      tooltips: ['Alvin', 'Pete', 'Hoolio', 'Jack',''],
                      tooltipsEffect: 'fade',
                      //annotatable: true
                      //textAccessible: true
                  }
              }).trace2();

Thanks,
Ananth
Posted by Richard on 24th October 2017
Hi there,

You could use the ylabelsSpecific option (I think that's the name of it) and then set the Y labels to whatever you choose.

Richard
Posted by Ananth on 24th October 2017
Hi Richard,

can you please specify an example in www.rgraph.net/tests/line/ananth.html? i was looking for yvalue fhould be increased by 500 or 100 or 10 or 20 etc

Thanks,
Ananth
Posted by Richard on 24th October 2017
Hi there,

Hold on, so you actually mean something like the ylabelsCount option? Like this example which has seven Y labels instead of five:

www.rgraph.net/demos/bar-numlabels.html

You can see the configuration values used in the source code on that page.

Richard
Posted by Ananth on 25th October 2017
Hi Richard,

your example looks good with multiples of 100 can we get those values in multiples of 1000's?

Thanks,
Ananth
Posted by Ananth on 25th October 2017
Hi Richard,

i was able to do this in code using MOD algorithm to get that min max value and specified ylabelsCount fulfilled my request ! thank you!

Thanks,
Ananth

Add a reply




« Back to message list