var myConfig = {
\t type: "scatter",
\t plot : {
\t marker : {
\t size : 10
\t }
\t },
\t series : [
\t \t {
\t \t \t values : [35,42,67,89,25,100,67,100]
\t \t }
\t ],
\t plotarea :{
\t padding : "10px"
\t },
\t scaleY : {
\t values : "0:90:10"
\t }
};
zingchart.render({
\t id : 'myChart',
\t data : myConfig,
\t height: 200,
\t width: 300
});
function preProcessData(){
var myValues = [35,42,67,89,25,100,67,100];
var maxVal = Math.max.apply(null,myValues);
var maxScale = maxVal + Math.floor(maxVal * 0.10);
return {
\t type: "scatter",
\t plot : {
\t marker : {
\t size : 10
\t }
\t },
\t series : [
\t \t {
\t \t \t values : myValues
\t \t }
\t ],
\t plotarea :{
\t padding : "10px"
\t },
\t scaleY : {
\t values : "0:"+maxScale+":10"
\t }
};
}
zingchart.render({
\t id : 'myChart2',
\t data : preProcessData(),
\t height: 200,
\t width: 300
});
<html>
\t <head>
\t \t <script src= 'https://cdn.zingchart.com/zingchart.min.js'></script>
\t </head>
\t <body>
\t \t <div id='myChart'></div>
\t \t <div id="myChart2"></div>
\t </body>
</html>